Devextreme-angular: Unit test fails - Can't bind to 'value' since it isn't a known property of 'dx-text-box'.

Created on 23 Sep 2016  路  1Comment  路  Source: DevExpress/devextreme-angular

Error message appears when running the unit test of a component which is using devExtreme-angular2 controls. Project is using webpack build and unit tests are executed using npm test command.

Please find the detailed error log
user.component.ts
脳 test add new user
PhantomJS 2.1.1 (Windows 8 0.0.0)
Error: Template parse errors:
Can't bind to 'value' since it isn't a known property of 'dx-text-box'.
1. If 'dx-text-box' is an Angular component and it has 'value' input, then verify that it is part of this module.
2. If 'dx-text-box' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schema' of this component to suppress this message.
("-12">

][(value)]="user.name">


"): UserComponent@17:42
'dx-text-box' is not a known element:
1. If 'dx-text-box' is an Angular component, then verify that it is part of this module.
2. If 'dx-text-box' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schema' of this component to suppress this message. ("


[ERROR ->]


"): UserComponent@17:12
"): UserComponent@49:12 in karma-shim.js (line 62961)
parse@webpack:///~/@angular/compiler/bundles/compiler.umd.js:8530:0 <- karma-shim.js:62961:73
_compileTemplate@webpack:///~/@angular/compiler/bundles/compiler.umd.js:16905:0 <- karma-shim.js:71336:59
webpack:///~/@angular/compiler/bundles/compiler.umd.js:16828:77 <- karma-shim.js:71259:102
forEach@webpack:///~/core-js/client/shim.js:4532:0 <- karma-shim.js:4622:14
compile@webpack:///~/@angular/compiler/bundles/compiler.umd.js:16828:37 <- karma-shim.js:71259:57
_compileComponents@webpack:///~/@angular/compiler/bundles/compiler.umd.js:16830:0 <- karma-shim.js:71261:23
_compileModuleAndAllComponents@webpack:///~/@angular/compiler/bundles/compiler.umd.js:16747:0 <- karma-shim.js:71178:58
compileModuleAndAllComponentsSync@webpack:///~/@angular/compiler/bundles/compiler.umd.js:16735:0 <- karma-shim.js:71166:54
compileModuleAndAllComponentsSync@webpack:///~/@angular/compiler/bundles/compiler-testing.umd.js:758:0 <- karma-shim.js:54371:69
_initIfNeeded@webpack:///~/@angular/core/bundles/core-testing.umd.js:1059:0 <- karma-shim.js:11805:74
createComponent@webpack:///~/@angular/core/bundles/core-testing.umd.js:1141:0 <- karma-shim.js:11887:32
createComponent@webpack:///~/@angular/core/bundles/core-testing.umd.js:972:0 <- karma-shim.js:11718:49
webpack:///src/app/users/user.component.spec.ts:47:0 <- karma-shim.js:33237:53
invoke@webpack:///~/zone.js/dist/zone.js:203:0 <- karma-shim.js:8581:34
onInvoke@webpack:///~/zone.js/dist/proxy.js:72:0 <- karma-shim.js:10121:46
invoke@webpack:///~/zone.js/dist/zone.js:202:0 <- karma-shim.js:8580:43
run@webpack:///~/zone.js/dist/zone.js:96:0 <- karma-shim.js:8474:50
webpack:///~/zone.js/dist/jasmine-patch.js:91:27 <- karma-shim.js:10309:54
execute@webpack:///~/zone.js/dist/jasmine-patch.js:119:0 <- karma-shim.js:10337:47
execute@webpack:///~/zone.js/dist/jasmine-patch.js:119:0 <- karma-shim.js:10337:47
invokeTask@webpack:///~/zone.js/dist/zone.js:236:0 <- karma-shim.js:8614:43
runTask@webpack:///~/zone.js/dist/zone.js:136:0 <- karma-shim.js:8514:58
drainMicroTaskQueue@webpack:///~/zone.js/dist/zone.js:368:0 <- karma-shim.js:8746:43
run@webpack:///~/core-js/client/shim.js:4005:0 <- karma-shim.js:4095:31
webpack:///~/core-js/client/shim.js:4018:0 <- karma-shim.js:4108:33
flush@webpack:///~/core-js/client/shim.js:4373:0 <- karma-shim.js:4463:13

Most helpful comment

Issue resolved after importing 'DevExtremeModule' as given below.
beforeEach(() => {
TestBed.configureTestingModule(
{
declarations: [TestComponent],
imports: [DevExtremeModule],

So closing the issue

>All comments

Issue resolved after importing 'DevExtremeModule' as given below.
beforeEach(() => {
TestBed.configureTestingModule(
{
declarations: [TestComponent],
imports: [DevExtremeModule],

So closing the issue

Was this page helpful?
0 / 5 - 0 ratings