mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
refactor(toggle): platform config toggle styles
This commit is contained in:
@@ -66,7 +66,6 @@ describe('Ionic Toggle', function() {
|
||||
expect(toggle.val()).toBe(true);
|
||||
ionic.trigger('click', {target: label});
|
||||
expect(toggle.val()).toBe(false);
|
||||
|
||||
});
|
||||
|
||||
it('Should have toggle class', function() {
|
||||
@@ -80,4 +79,19 @@ describe('Ionic Toggle', function() {
|
||||
expect(label.hasClass('toggle-dark')).toEqual(true);
|
||||
});
|
||||
|
||||
it('Should add config class', inject(function($ionicConfig){
|
||||
el = compile('<ion-toggle>')(rootScope);
|
||||
expect(el.hasClass('toggle-large')).toBe(true);
|
||||
|
||||
$ionicConfig.form.toggle('small');
|
||||
el = compile('<ion-toggle>')(rootScope);
|
||||
expect(el.hasClass('toggle-small')).toBe(true);
|
||||
|
||||
$ionicConfig.form.toggle('whatever');
|
||||
el = compile('<ion-toggle>')(rootScope);
|
||||
expect(el.hasClass('toggle-large')).toBe(false);
|
||||
expect(el.hasClass('toggle-sall')).toBe(false);
|
||||
expect(el.hasClass('toggle-whatever')).toBe(true);
|
||||
}));
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user