Commit c796304e authored by Kushal Pandya's avatar Kushal Pandya

Update tests for toggle design change

parent b11c7912
...@@ -30,9 +30,9 @@ describe('Toggle Button', () => { ...@@ -30,9 +30,9 @@ describe('Toggle Button', () => {
expect(vm.$el.querySelector('input').getAttribute('value')).toEqual('true'); expect(vm.$el.querySelector('input').getAttribute('value')).toEqual('true');
}); });
it('renders Enabled and Disabled text data attributes', () => { it('renders input status icon', () => {
expect(vm.$el.querySelector('button').getAttribute('data-enabled-text')).toEqual('Enabled'); expect(vm.$el.querySelectorAll('span.toggle-icon').length).toEqual(1);
expect(vm.$el.querySelector('button').getAttribute('data-disabled-text')).toEqual('Disabled'); expect(vm.$el.querySelectorAll('svg.s16.toggle-icon-svg').length).toEqual(1);
}); });
}); });
...@@ -49,6 +49,14 @@ describe('Toggle Button', () => { ...@@ -49,6 +49,14 @@ describe('Toggle Button', () => {
expect(vm.$el.querySelector('button').classList.contains('is-checked')).toEqual(true); expect(vm.$el.querySelector('button').classList.contains('is-checked')).toEqual(true);
}); });
it('sets aria-label representing toggle state', () => {
vm.value = true;
expect(vm.ariaLabel).toEqual('Toggle Status: ON');
vm.value = false;
expect(vm.ariaLabel).toEqual('Toggle Status: OFF');
});
it('emits change event when clicked', () => { it('emits change event when clicked', () => {
vm.$el.querySelector('button').click(); vm.$el.querySelector('button').click();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment