Skip to content
This repository was archived by the owner on Apr 30, 2018. It is now read-only.

Commit af99394

Browse files
test(defaultValue): failing test for nested keys
added failing test for #468
1 parent 3c45ae5 commit af99394

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/directives/formly-field.test.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,9 +451,13 @@ describe('formly-field', function() {
451451
describe(`defaultValue`, () => {
452452
const key = '♪┏(・o・)┛♪┗ ( ・o・) ┓♪';
453453
const defaultValue = '~=[,,_,,]:3';
454+
const nested = 'nested';
455+
const nestedKey = 'nested.field';
456+
454457
beforeEach(() => {
455458
scope.fields = [
456-
{template: input, key, defaultValue}
459+
{template: input, key, defaultValue},
460+
{template: input, key: nestedKey, defaultValue}
457461
];
458462
scope.model = {};
459463
});
@@ -498,6 +502,14 @@ describe('formly-field', function() {
498502

499503
expect(scope.fields[0].initialValue).to.eq(defaultValue);
500504
});
505+
506+
it.skip(`should set the default value for nested keys`, () => {
507+
compileAndDigest();
508+
// This should pass
509+
expect(scope.model[nested].field).to.equal(defaultValue);
510+
// This should not pass
511+
expect(scope.model[nestedKey]).to.equal(defaultValue);
512+
});
501513
});
502514

503515
describe(`id property`, () => {

0 commit comments

Comments
 (0)