Jasmine unit tests for angular with tree table

UI Components for Angular
Post Reply
surendra
Posts: 1
Joined: 15 Oct 2018, 16:01

15 Oct 2018, 16:17

Hi,

I'm working on a Angular project, in one of the page we are using tree table component and when tried to write the jasmine tests in spec file, facing below issues, can you please help on this how to fix this issue and to proceed writing unit tests for the code in component.

Can't bind to 'value' since it isn't a known property of 'p-treeTable'.
1. If 'p-treeTable' is an Angular component and it has 'value' input, then verify that it is part of this module.
2. If 'p-treeTable' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

yigitfindikli
Posts: 449
Joined: 08 Aug 2018, 14:09

16 Oct 2018, 15:18

Hi,
can i see your imports and declarations in test file ?
You can use that in my opinion

Code: Select all

import { TestBed, ComponentFixture } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { TreeTable, TTBody, TTScrollableView } from './treetable';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { Paginator } from '../paginator/paginator';
import { Dropdown } from '../dropdown/dropdown';
import { FormsModule } from '../../../../node_modules/@angular/forms';

...
imports: [
        ...
        NoopAnimationsModule,
        FormsModule
        ...
        ],
        declarations: [
        ...
        TreeTable,
        Paginator,
        TTBody,
        TTScrollableView,
        Dropdown
        ...
        ]
    });


Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 12 guests