Commit 949b959f authored by leiminghuan's avatar leiminghuan

supply tests

parent 1ab45d47
...@@ -103,6 +103,7 @@ export default { ...@@ -103,6 +103,7 @@ export default {
<template> <template>
<div> <div>
<span <span
ref="tooltip"
v-tooltip v-tooltip
class="sidebar-collapsed-icon" class="sidebar-collapsed-icon"
:title="notificationTooltip" :title="notificationTooltip"
......
...@@ -77,19 +77,24 @@ describe('Subscriptions', function() { ...@@ -77,19 +77,24 @@ describe('Subscriptions', function() {
expect(vm.$emit).toHaveBeenCalledWith('toggleSidebar'); expect(vm.$emit).toHaveBeenCalledWith('toggleSidebar');
}); });
it('notify component disabled when project_emails_disabled is set on', () => { describe('given project emails are disabled', () => {
vm = mountComponent(Subscriptions, { const subscribeDisabledDescription = 'Notifications have been disabled';
subscribed: true,
projectEmailsDisabled: true, beforeEach(() => {
subscribeDisabledDescription: 'Notifications have been disabled', vm = mountComponent(Subscriptions, {
subscribed: false,
projectEmailsDisabled: true,
subscribeDisabledDescription,
});
}); });
expect(vm.$el.querySelector('span').getAttribute('data-original-title')).toBe( it('sets the correct display text', () => {
vm.subscribeDisabledDescription, expect(vm.$el.textContent).toContain(subscribeDisabledDescription);
); expect(vm.$refs.tooltip.dataset.originalTitle).toBe(subscribeDisabledDescription);
});
expect(vm.$el.querySelector('.issuable-header-text').textContent.trim()).toBe( it('does not render the toggle button', () => {
vm.subscribeDisabledDescription, expect(vm.$refs.toggleButton).toBeUndefined();
); });
}); });
}); });
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