diff options
author | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 22:34:23 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 22:34:23 +0300 |
commit | 6438df3a1e0fb944485cebf07976160184697d72 (patch) | |
tree | 00b09bfd170e77ae9391b1a2f5a93ef6839f2597 /spec/frontend/vue_shared/components/expand_button_spec.js | |
parent | 42bcd54d971da7ef2854b896a7b34f4ef8601067 (diff) |
Add latest changes from gitlab-org/gitlab@13-8-stable-eev13.8.0-rc42
Diffstat (limited to 'spec/frontend/vue_shared/components/expand_button_spec.js')
-rw-r--r-- | spec/frontend/vue_shared/components/expand_button_spec.js | 57 |
1 files changed, 11 insertions, 46 deletions
diff --git a/spec/frontend/vue_shared/components/expand_button_spec.js b/spec/frontend/vue_shared/components/expand_button_spec.js index aea90e5b31f..724405a109f 100644 --- a/spec/frontend/vue_shared/components/expand_button_spec.js +++ b/spec/frontend/vue_shared/components/expand_button_spec.js @@ -41,12 +41,7 @@ describe('Expand button', () => { }); it('does not render expanded text', () => { - expect( - wrapper - .find(ExpandButton) - .text() - .trim(), - ).not.toBe(text.short); + expect(wrapper.find(ExpandButton).text().trim()).not.toBe(text.short); }); describe('when short text is provided', () => { @@ -60,12 +55,7 @@ describe('Expand button', () => { }); it('renders short text', () => { - expect( - wrapper - .find(ExpandButton) - .text() - .trim(), - ).toBe(text.short); + expect(wrapper.find(ExpandButton).text().trim()).toBe(text.short); }); it('renders button before text', () => { @@ -76,7 +66,7 @@ describe('Expand button', () => { }); describe('on click', () => { - beforeEach(done => { + beforeEach((done) => { expanderPrependEl().trigger('click'); Vue.nextTick(done); }); @@ -95,7 +85,7 @@ describe('Expand button', () => { }); describe('when short text is provided', () => { - beforeEach(done => { + beforeEach((done) => { factory({ slots: { expanded: `<p>${text.expanded}</p>`, @@ -108,12 +98,7 @@ describe('Expand button', () => { }); it('only renders expanded text', () => { - expect( - wrapper - .find(ExpandButton) - .text() - .trim(), - ).toBe(text.expanded); + expect(wrapper.find(ExpandButton).text().trim()).toBe(text.expanded); }); it('renders button after text', () => { @@ -125,7 +110,7 @@ describe('Expand button', () => { }); describe('append button', () => { - beforeEach(done => { + beforeEach((done) => { expanderPrependEl().trigger('click'); Vue.nextTick(done); }); @@ -140,26 +125,16 @@ describe('Expand button', () => { }); it('clicking hides expanded text', () => { - expect( - wrapper - .find(ExpandButton) - .text() - .trim(), - ).toBe(text.expanded); + expect(wrapper.find(ExpandButton).text().trim()).toBe(text.expanded); expanderAppendEl().trigger('click'); return wrapper.vm.$nextTick().then(() => { - expect( - wrapper - .find(ExpandButton) - .text() - .trim(), - ).not.toBe(text.expanded); + expect(wrapper.find(ExpandButton).text().trim()).not.toBe(text.expanded); }); }); describe('when short text is provided', () => { - beforeEach(done => { + beforeEach((done) => { factory({ slots: { expanded: `<p>${text.expanded}</p>`, @@ -172,21 +147,11 @@ describe('Expand button', () => { }); it('clicking reveals short text', () => { - expect( - wrapper - .find(ExpandButton) - .text() - .trim(), - ).toBe(text.expanded); + expect(wrapper.find(ExpandButton).text().trim()).toBe(text.expanded); expanderAppendEl().trigger('click'); return wrapper.vm.$nextTick().then(() => { - expect( - wrapper - .find(ExpandButton) - .text() - .trim(), - ).toBe(text.short); + expect(wrapper.find(ExpandButton).text().trim()).toBe(text.short); }); }); }); |