diff options
Diffstat (limited to 'spec/frontend/vue_mr_widget/components/states/mr_widget_archived_spec.js')
-rw-r--r-- | spec/frontend/vue_mr_widget/components/states/mr_widget_archived_spec.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/frontend/vue_mr_widget/components/states/mr_widget_archived_spec.js b/spec/frontend/vue_mr_widget/components/states/mr_widget_archived_spec.js new file mode 100644 index 00000000000..4bdc6c95f22 --- /dev/null +++ b/spec/frontend/vue_mr_widget/components/states/mr_widget_archived_spec.js @@ -0,0 +1,31 @@ +import Vue from 'vue'; +import mountComponent from 'helpers/vue_mount_component_helper'; +import archivedComponent from '~/vue_merge_request_widget/components/states/mr_widget_archived.vue'; + +describe('MRWidgetArchived', () => { + let vm; + + beforeEach(() => { + const Component = Vue.extend(archivedComponent); + vm = mountComponent(Component); + }); + + afterEach(() => { + vm.$destroy(); + }); + + it('renders a ci status failed icon', () => { + expect(vm.$el.querySelector('.ci-status-icon')).not.toBeNull(); + }); + + it('renders a disabled button', () => { + expect(vm.$el.querySelector('button').getAttribute('disabled')).toEqual('disabled'); + expect(vm.$el.querySelector('button').textContent.trim()).toEqual('Merge'); + }); + + it('renders information', () => { + expect(vm.$el.querySelector('.bold').textContent.trim()).toEqual( + 'This project is archived, write access has been disabled', + ); + }); +}); |