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

Commit 6094ee3

Browse files
committed
Adding failing test to deal with multiple form controllers. Related to Bug #423 and the note: "Note, this doesn't handle the multiple ng-model case. If you want to implement that, that would be great."
1 parent 10ee65f commit 6094ee3

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/directives/formly-field.test.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,6 +1027,30 @@ describe('formly-field', function() {
10271027

10281028
expect(ctrl.$viewValue).to.equal('!hello!');
10291029
});
1030+
1031+
it.skip(`should handle multiple form controllers when formatting a model value right from the start`, () => {
1032+
scope.model = {
1033+
multiNgModel: {
1034+
start: 'start',
1035+
stop: 'stop'
1036+
}
1037+
};
1038+
const field = getNewField({
1039+
key: 'multiNgModel',
1040+
template: multiNgModelField,
1041+
formatters: ['"!" + $viewValue + "!"']
1042+
});
1043+
scope.fields = [field];
1044+
1045+
compileAndDigest();
1046+
1047+
const ctrl1 = field.formControl[0];
1048+
const ctrl2 = field.formControl[1];
1049+
1050+
expect(ctrl1.$viewValue).to.equal('!start!');
1051+
expect(ctrl2.$viewValue).to.equal('!stop!');
1052+
});
1053+
10301054
});
10311055

10321056
function testParsersOrFormatters(which) {

0 commit comments

Comments
 (0)