diff options
Diffstat (limited to 'spec/frontend/badges/components')
4 files changed, 17 insertions, 21 deletions
diff --git a/spec/frontend/badges/components/badge_form_spec.js b/spec/frontend/badges/components/badge_form_spec.js index 1edc9adbfb2..34c65d51115 100644 --- a/spec/frontend/badges/components/badge_form_spec.js +++ b/spec/frontend/badges/components/badge_form_spec.js @@ -50,7 +50,7 @@ describe('BadgeForm component', () => { }); }); - const sharedSubmitTests = submitAction => { + const sharedSubmitTests = (submitAction) => { const nameSelector = '#badge-name'; const imageUrlSelector = '#badge-image-url'; const findImageUrlElement = () => vm.$el.querySelector(imageUrlSelector); @@ -65,7 +65,7 @@ describe('BadgeForm component', () => { const submitButton = vm.$el.querySelector('button[type="submit"]'); submitButton.click(); }; - const expectInvalidInput = inputElementSelector => { + const expectInvalidInput = (inputElementSelector) => { const inputElement = vm.$el.querySelector(inputElementSelector); expect(inputElement.checkValidity()).toBe(false); @@ -74,7 +74,7 @@ describe('BadgeForm component', () => { expect(feedbackElement).toBeVisible(); }; - beforeEach(done => { + beforeEach((done) => { jest.spyOn(vm, submitAction).mockReturnValue(Promise.resolve()); store.replaceState({ ...store.state, diff --git a/spec/frontend/badges/components/badge_list_row_spec.js b/spec/frontend/badges/components/badge_list_row_spec.js index 31f0d850857..c559c979cb3 100644 --- a/spec/frontend/badges/components/badge_list_row_spec.js +++ b/spec/frontend/badges/components/badge_list_row_spec.js @@ -73,7 +73,7 @@ describe('BadgeListRow component', () => { expect(vm.editBadge).toHaveBeenCalled(); }); - it('calls updateBadgeInModal and shows modal when clicking then delete button', done => { + it('calls updateBadgeInModal and shows modal when clicking then delete button', (done) => { jest.spyOn(vm, 'updateBadgeInModal').mockImplementation(() => {}); const deleteButton = vm.$el.querySelector('.table-button-footer button:last-of-type'); @@ -88,12 +88,10 @@ describe('BadgeListRow component', () => { }); describe('for a group badge', () => { - beforeEach(done => { + beforeEach((done) => { badge.kind = GROUP_BADGE; - Vue.nextTick() - .then(done) - .catch(done.fail); + Vue.nextTick().then(done).catch(done.fail); }); it('renders the badge kind', () => { diff --git a/spec/frontend/badges/components/badge_list_spec.js b/spec/frontend/badges/components/badge_list_spec.js index 5ffc046eb97..da59e13e1e9 100644 --- a/spec/frontend/badges/components/badge_list_spec.js +++ b/spec/frontend/badges/components/badge_list_spec.js @@ -48,7 +48,7 @@ describe('BadgeList component', () => { expect(rows).toHaveLength(numberOfDummyBadges); }); - it('renders a message if no badges exist', done => { + it('renders a message if no badges exist', (done) => { store.state.badges = []; Vue.nextTick() @@ -59,7 +59,7 @@ describe('BadgeList component', () => { .catch(done.fail); }); - it('shows a loading icon when loading', done => { + it('shows a loading icon when loading', (done) => { store.state.isLoading = true; Vue.nextTick() @@ -73,15 +73,13 @@ describe('BadgeList component', () => { }); describe('for group badges', () => { - beforeEach(done => { + beforeEach((done) => { store.state.kind = GROUP_BADGE; - Vue.nextTick() - .then(done) - .catch(done.fail); + Vue.nextTick().then(done).catch(done.fail); }); - it('renders a message if no badges exist', done => { + it('renders a message if no badges exist', (done) => { store.state.badges = []; Vue.nextTick() diff --git a/spec/frontend/badges/components/badge_spec.js b/spec/frontend/badges/components/badge_spec.js index 43004004fb2..990bc094d59 100644 --- a/spec/frontend/badges/components/badge_spec.js +++ b/spec/frontend/badges/components/badge_spec.js @@ -23,7 +23,7 @@ describe('Badge component', () => { const createComponent = (props, el = null) => { vm = mountComponent(Component, props, el); const { badgeImage } = findElements(); - return new Promise(resolve => { + return new Promise((resolve) => { badgeImage.addEventListener('load', resolve); // Manually dispatch load event as it is not triggered badgeImage.dispatchEvent(new Event('load')); @@ -36,7 +36,7 @@ describe('Badge component', () => { describe('watchers', () => { describe('imageUrl', () => { - it('sets isLoading and resets numRetries and hasError', done => { + it('sets isLoading and resets numRetries and hasError', (done) => { const props = { ...dummyProps }; createComponent(props) .then(() => { @@ -60,7 +60,7 @@ describe('Badge component', () => { }); describe('methods', () => { - beforeEach(done => { + beforeEach((done) => { createComponent({ ...dummyProps }) .then(done) .catch(done.fail); @@ -98,7 +98,7 @@ describe('Badge component', () => { }); describe('behavior', () => { - beforeEach(done => { + beforeEach((done) => { setFixtures('<div id="dummy-element"></div>'); createComponent({ ...dummyProps }, '#dummy-element') .then(done) @@ -116,7 +116,7 @@ describe('Badge component', () => { expect(vm.$el.querySelector('.btn-group')).toBeHidden(); }); - it('shows a loading icon when loading', done => { + it('shows a loading icon when loading', (done) => { vm.isLoading = true; Vue.nextTick() @@ -132,7 +132,7 @@ describe('Badge component', () => { .catch(done.fail); }); - it('shows an error and reload button if loading failed', done => { + it('shows an error and reload button if loading failed', (done) => { vm.hasError = true; Vue.nextTick() |