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

Commit 7caba3f

Browse files
committed
test(NgModel): fix input type=color default value
- "#000000" for Chrome and Firefox - "" for Safari7 and IE11
1 parent b1d135e commit 7caba3f

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

test/directive/ng_model_spec.dart

+17-4
Original file line numberDiff line numberDiff line change
@@ -1025,20 +1025,33 @@ void main() {
10251025
_.compile('<input type="color" ng-model="model">');
10261026
_.rootScope.apply();
10271027

1028-
expect((_.rootElement as dom.InputElement).value).toEqual('#000000');
1028+
expect((_.rootElement as dom.InputElement).value, anyOf(
1029+
// Chrome, Firefox
1030+
equals('#000000'),
1031+
// IE11, Safari 7
1032+
equals('')));
10291033

10301034
_.rootScope.apply('model = "#123456"');
10311035
expect((_.rootElement as dom.InputElement).value).toEqual('#123456');
10321036
});
10331037

1034-
it('should render as #000000 on default and when a null value is present', () {
1038+
it(r'should render as "#000000"/"" on default and when a null value is present', () {
10351039
_.compile('<input type="color" ng-model="model">');
10361040
_.rootScope.apply();
10371041

1038-
expect((_.rootElement as dom.InputElement).value).toEqual('#000000');
1042+
expect((_.rootElement as dom.InputElement).value, anyOf(
1043+
// Chrome, Firefox
1044+
equals('#000000'),
1045+
// IE11, Safari 7
1046+
equals('')));
1047+
10391048

10401049
_.rootScope.apply('model = null');
1041-
expect((_.rootElement as dom.InputElement).value).toEqual('#000000');
1050+
expect((_.rootElement as dom.InputElement).value, anyOf(
1051+
// Chrome, Firefox
1052+
equals('#000000'),
1053+
// IE11, Safari 7
1054+
equals('')));
10421055
});
10431056

10441057
it('should update model from the input value', () {

0 commit comments

Comments
 (0)