Commit d77d1749 authored by Mike Greiling's avatar Mike Greiling

update karma tests

parent de19158c
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
{{ __('Notifications') }} {{ __('Notifications') }}
</span> </span>
<toggle-button <toggle-button
ref="loadingButton" ref="toggleButton"
class="pull-right hide-collapsed js-issuable-subscribe-button" class="pull-right hide-collapsed js-issuable-subscribe-button"
:is-loading="showLoadingState" :is-loading="showLoadingState"
:value="subscribed" :value="subscribed"
......
...@@ -20,23 +20,23 @@ describe('Subscriptions', function () { ...@@ -20,23 +20,23 @@ describe('Subscriptions', function () {
subscribed: undefined, subscribed: undefined,
}); });
expect(vm.$refs.loadingButton.loading).toBe(true); expect(vm.$refs.toggleButton.isLoading).toBe(true);
expect(vm.$refs.loadingButton.label).toBeUndefined(); expect(vm.$refs.toggleButton.$el.querySelector('.project-feature-toggle')).toHaveClass('is-loading');
}); });
it('has "Subscribe" text when currently not subscribed', () => { it('is toggled "off" when currently not subscribed', () => {
vm = mountComponent(Subscriptions, { vm = mountComponent(Subscriptions, {
subscribed: false, subscribed: false,
}); });
expect(vm.$refs.loadingButton.label).toBe('Subscribe'); expect(vm.$refs.toggleButton.$el.querySelector('.project-feature-toggle')).not.toHaveClass('is-checked');
}); });
it('has "Unsubscribe" text when currently not subscribed', () => { it('is toggled "on" when currently subscribed', () => {
vm = mountComponent(Subscriptions, { vm = mountComponent(Subscriptions, {
subscribed: true, subscribed: true,
}); });
expect(vm.$refs.loadingButton.label).toBe('Unsubscribe'); expect(vm.$refs.toggleButton.$el.querySelector('.project-feature-toggle')).toHaveClass('is-checked');
}); });
}); });
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