diff options
Diffstat (limited to 'spec/frontend/ci_variable_list')
6 files changed, 23 insertions, 36 deletions
diff --git a/spec/frontend/ci_variable_list/ci_variable_list/ci_variable_list_spec.js b/spec/frontend/ci_variable_list/ci_variable_list/ci_variable_list_spec.js index 4a2e56c570d..ad1bdec1735 100644 --- a/spec/frontend/ci_variable_list/ci_variable_list/ci_variable_list_spec.js +++ b/spec/frontend/ci_variable_list/ci_variable_list/ci_variable_list_spec.js @@ -31,10 +31,7 @@ describe('VariableList', () => { it('should add another row when editing the last rows key input', () => { const $row = $wrapper.find('.js-row'); - $row - .find('.js-ci-variable-input-key') - .val('foo') - .trigger('input'); + $row.find('.js-ci-variable-input-key').val('foo').trigger('input'); expect($wrapper.find('.js-row').length).toBe(2); @@ -46,10 +43,7 @@ describe('VariableList', () => { it('should add another row when editing the last rows value textarea', () => { const $row = $wrapper.find('.js-row'); - $row - .find('.js-ci-variable-input-value') - .val('foo') - .trigger('input'); + $row.find('.js-ci-variable-input-value').val('foo').trigger('input'); expect($wrapper.find('.js-row').length).toBe(2); @@ -61,18 +55,11 @@ describe('VariableList', () => { it('should remove empty row after blurring', () => { const $row = $wrapper.find('.js-row'); - $row - .find('.js-ci-variable-input-key') - .val('foo') - .trigger('input'); + $row.find('.js-ci-variable-input-key').val('foo').trigger('input'); expect($wrapper.find('.js-row').length).toBe(2); - $row - .find('.js-ci-variable-input-key') - .val('') - .trigger('input') - .trigger('blur'); + $row.find('.js-ci-variable-input-key').val('').trigger('input').trigger('blur'); expect($wrapper.find('.js-row').length).toBe(1); }); diff --git a/spec/frontend/ci_variable_list/components/ci_environments_dropdown_spec.js b/spec/frontend/ci_variable_list/components/ci_environments_dropdown_spec.js index 7bcd558c60f..faa88394447 100644 --- a/spec/frontend/ci_variable_list/components/ci_environments_dropdown_spec.js +++ b/spec/frontend/ci_variable_list/components/ci_environments_dropdown_spec.js @@ -10,7 +10,7 @@ describe('Ci environments dropdown', () => { let wrapper; let store; - const createComponent = term => { + const createComponent = (term) => { store = new Vuex.Store({ getters: { joinedEnvironments: () => ['dev', 'prod', 'staging'], @@ -27,8 +27,8 @@ describe('Ci environments dropdown', () => { }; const findAllDropdownItems = () => wrapper.findAll(GlDropdownItem); - const findDropdownItemByIndex = index => wrapper.findAll(GlDropdownItem).at(index); - const findActiveIconByIndex = index => findDropdownItemByIndex(index).find(GlIcon); + const findDropdownItemByIndex = (index) => wrapper.findAll(GlDropdownItem).at(index); + const findActiveIconByIndex = (index) => findDropdownItemByIndex(index).find(GlIcon); afterEach(() => { wrapper.destroy(); @@ -78,7 +78,7 @@ describe('Ci environments dropdown', () => { }); it('should not display create button', () => { - const environments = findAllDropdownItems().filter(env => env.text().startsWith('Create')); + const environments = findAllDropdownItems().filter((env) => env.text().startsWith('Create')); expect(environments).toHaveLength(0); expect(findAllDropdownItems()).toHaveLength(1); }); diff --git a/spec/frontend/ci_variable_list/components/ci_variable_modal_spec.js b/spec/frontend/ci_variable_list/components/ci_variable_modal_spec.js index 5c2d096418d..b2e51029a06 100644 --- a/spec/frontend/ci_variable_list/components/ci_variable_modal_spec.js +++ b/spec/frontend/ci_variable_list/components/ci_variable_modal_spec.js @@ -17,7 +17,7 @@ describe('Ci variable modal', () => { const createComponent = (method, options = {}) => { store = createStore(); wrapper = method(CiVariableModal, { - attachToDocument: true, + attachTo: document.body, stubs: { GlModal: ModalStub, }, @@ -31,11 +31,11 @@ describe('Ci variable modal', () => { const findAddorUpdateButton = () => findModal() .findAll(GlButton) - .wrappers.find(button => button.props('variant') === 'success'); + .wrappers.find((button) => button.props('variant') === 'success'); const deleteVariableButton = () => findModal() .findAll(GlButton) - .wrappers.find(button => button.props('variant') === 'danger'); + .wrappers.find((button) => button.props('variant') === 'danger'); afterEach(() => { wrapper.destroy(); diff --git a/spec/frontend/ci_variable_list/components/ci_variable_settings_spec.js b/spec/frontend/ci_variable_list/components/ci_variable_settings_spec.js index 7dcd82eac5e..12449fc7615 100644 --- a/spec/frontend/ci_variable_list/components/ci_variable_settings_spec.js +++ b/spec/frontend/ci_variable_list/components/ci_variable_settings_spec.js @@ -11,7 +11,7 @@ describe('Ci variable table', () => { let store; let isGroup; - const createComponent = groupState => { + const createComponent = (groupState) => { store = createStore(); store.state.isGroup = groupState; jest.spyOn(store, 'dispatch').mockImplementation(); diff --git a/spec/frontend/ci_variable_list/components/ci_variable_table_spec.js b/spec/frontend/ci_variable_list/components/ci_variable_table_spec.js index 36aeffe7798..fbc34528d4d 100644 --- a/spec/frontend/ci_variable_list/components/ci_variable_table_spec.js +++ b/spec/frontend/ci_variable_list/components/ci_variable_table_spec.js @@ -17,7 +17,7 @@ describe('Ci variable table', () => { store.state.isGroup = true; jest.spyOn(store, 'dispatch').mockImplementation(); wrapper = mount(CiVariableTable, { - attachToDocument: true, + attachTo: document.body, localVue, store, }); diff --git a/spec/frontend/ci_variable_list/store/actions_spec.js b/spec/frontend/ci_variable_list/store/actions_spec.js index 4b89e467df0..075e5829305 100644 --- a/spec/frontend/ci_variable_list/store/actions_spec.js +++ b/spec/frontend/ci_variable_list/store/actions_spec.js @@ -86,7 +86,7 @@ describe('CI variable list store actions', () => { }); describe('deleteVariable', () => { - it('dispatch correct actions on successful deleted variable', done => { + it('dispatch correct actions on successful deleted variable', (done) => { mock.onPatch(state.endpoint).reply(200); testAction( @@ -105,7 +105,7 @@ describe('CI variable list store actions', () => { ); }); - it('should show flash error and set error in state on delete failure', done => { + it('should show flash error and set error in state on delete failure', (done) => { mock.onPatch(state.endpoint).reply(500, ''); testAction( @@ -129,7 +129,7 @@ describe('CI variable list store actions', () => { }); describe('updateVariable', () => { - it('dispatch correct actions on successful updated variable', done => { + it('dispatch correct actions on successful updated variable', (done) => { mock.onPatch(state.endpoint).reply(200); testAction( @@ -148,7 +148,7 @@ describe('CI variable list store actions', () => { ); }); - it('should show flash error and set error in state on update failure', done => { + it('should show flash error and set error in state on update failure', (done) => { mock.onPatch(state.endpoint).reply(500, ''); testAction( @@ -172,7 +172,7 @@ describe('CI variable list store actions', () => { }); describe('addVariable', () => { - it('dispatch correct actions on successful added variable', done => { + it('dispatch correct actions on successful added variable', (done) => { mock.onPatch(state.endpoint).reply(200); testAction( @@ -191,7 +191,7 @@ describe('CI variable list store actions', () => { ); }); - it('should show flash error and set error in state on add failure', done => { + it('should show flash error and set error in state on add failure', (done) => { mock.onPatch(state.endpoint).reply(500, ''); testAction( @@ -215,7 +215,7 @@ describe('CI variable list store actions', () => { }); describe('fetchVariables', () => { - it('dispatch correct actions on fetchVariables', done => { + it('dispatch correct actions on fetchVariables', (done) => { mock.onGet(state.endpoint).reply(200, { variables: mockData.mockVariables }); testAction( @@ -236,7 +236,7 @@ describe('CI variable list store actions', () => { ); }); - it('should show flash error and set error in state on fetch variables failure', done => { + it('should show flash error and set error in state on fetch variables failure', (done) => { mock.onGet(state.endpoint).reply(500); testAction(actions.fetchVariables, {}, state, [], [{ type: 'requestVariables' }], () => { @@ -247,7 +247,7 @@ describe('CI variable list store actions', () => { }); describe('fetchEnvironments', () => { - it('dispatch correct actions on fetchEnvironments', done => { + it('dispatch correct actions on fetchEnvironments', (done) => { Api.environments = jest.fn().mockResolvedValue({ data: mockData.mockEnvironments }); testAction( @@ -268,7 +268,7 @@ describe('CI variable list store actions', () => { ); }); - it('should show flash error and set error in state on fetch environments failure', done => { + it('should show flash error and set error in state on fetch environments failure', (done) => { Api.environments = jest.fn().mockRejectedValue(); testAction( |