Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 1663341

Browse files
topherfangioThomasBurleson
authored andcommitted
refactor(select): Separate option value test into multiple.
Refactor the various `value=` and `ng-value=` option test into a separate test for each value type so we can more easily see if a particular one fails. Closes #9041
1 parent ae5eec4 commit 1663341

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

src/components/select/select.spec.js

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -280,18 +280,16 @@ describe('<md-select>', function() {
280280
el.remove();
281281
}));
282282

283-
it('should unset has-value class on container for empty value option', inject(function($rootScope) {
284-
var templates = [
285-
'<md-option></md-option>',
286-
'<md-option value></md-option>',
287-
'<md-option value>None</md-option>',
288-
'<md-option ng-value></md-option>',
289-
'<md-option ng-value>None</md-option>',
290-
'<md-option value=""></md-option>',
291-
'<md-option ng-value=""></md-option>'
292-
];
293-
294-
templates.forEach(function(template) {
283+
[
284+
'<md-option></md-option>',
285+
'<md-option value></md-option>',
286+
'<md-option value>None</md-option>',
287+
'<md-option ng-value></md-option>',
288+
'<md-option ng-value>None</md-option>',
289+
'<md-option value=""></md-option>',
290+
'<md-option ng-value=""></md-option>'
291+
].forEach(function(template) {
292+
it('should unset has-value class on container for empty value option (' + template + ')', inject(function($rootScope) {
295293
var el = setupSelect('ng-model="$root.value"',
296294
template + '<md-option ng-value="1">1</md-option>'
297295
);
@@ -314,8 +312,8 @@ describe('<md-select>', function() {
314312
expect(el).not.toHaveClass('md-input-has-value');
315313

316314
el.remove();
317-
});
318-
}));
315+
}));
316+
});
319317

320318
it('should match label to given input id', function() {
321319
var el = setupSelect('ng-model="$root.value" id="foo"');

0 commit comments

Comments
 (0)