From 6438df3a1e0fb944485cebf07976160184697d72 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Wed, 20 Jan 2021 13:34:23 -0600 Subject: Add latest changes from gitlab-org/gitlab@13-8-stable-ee --- spec/frontend/deploy_keys/components/app_spec.js | 20 ++++++-------------- spec/frontend/deploy_keys/components/key_spec.js | 13 +++---------- .../deploy_keys/components/keys_panel_spec.js | 11 ++++------- 3 files changed, 13 insertions(+), 31 deletions(-) (limited to 'spec/frontend/deploy_keys') diff --git a/spec/frontend/deploy_keys/components/app_spec.js b/spec/frontend/deploy_keys/components/app_spec.js index 291502c9ed7..479320f92f2 100644 --- a/spec/frontend/deploy_keys/components/app_spec.js +++ b/spec/frontend/deploy_keys/components/app_spec.js @@ -35,7 +35,7 @@ describe('Deploy keys app component', () => { }); const findLoadingIcon = () => wrapper.find('.gl-spinner'); - const findKeyPanels = () => wrapper.findAll('.deploy-keys .nav-links li'); + const findKeyPanels = () => wrapper.findAll('.deploy-keys .gl-tabs-nav li'); it('renders loading icon while waiting for request', () => { mock.onGet(TEST_ENDPOINT).reply(() => new Promise()); @@ -54,22 +54,14 @@ describe('Deploy keys app component', () => { }); it.each` - selector | label | count - ${'.js-deployKeys-tab-enabled_keys'} | ${'Enabled deploy keys'} | ${1} - ${'.js-deployKeys-tab-available_project_keys'} | ${'Privately accessible deploy keys'} | ${0} - ${'.js-deployKeys-tab-public_keys'} | ${'Publicly accessible deploy keys'} | ${1} - `('$selector title is $label with keys count equal to $count', ({ selector, label, count }) => { + selector + ${'.js-deployKeys-tab-enabled_keys'} + ${'.js-deployKeys-tab-available_project_keys'} + ${'.js-deployKeys-tab-public_keys'} + `('$selector title exists', ({ selector }) => { return mountComponent().then(() => { const element = wrapper.find(selector); expect(element.exists()).toBe(true); - expect(element.text().trim()).toContain(label); - - expect( - element - .find('.badge') - .text() - .trim(), - ).toBe(count.toString()); }); }); diff --git a/spec/frontend/deploy_keys/components/key_spec.js b/spec/frontend/deploy_keys/components/key_spec.js index d990c64c241..fcb4e31dec8 100644 --- a/spec/frontend/deploy_keys/components/key_spec.js +++ b/spec/frontend/deploy_keys/components/key_spec.js @@ -9,13 +9,9 @@ describe('Deploy keys key', () => { const data = getJSONFixture('deploy_keys/keys.json'); - const findTextAndTrim = selector => - wrapper - .find(selector) - .text() - .trim(); + const findTextAndTrim = (selector) => wrapper.find(selector).text().trim(); - const createComponent = propsData => { + const createComponent = (propsData) => { wrapper = mount(key, { propsData: { store, @@ -103,10 +99,7 @@ describe('Deploy keys key', () => { it('expands all project labels after click', () => { createComponent({ deployKey }); const { length } = deployKey.deploy_keys_projects; - wrapper - .findAll('.deploy-project-label') - .at(1) - .trigger('click'); + wrapper.findAll('.deploy-project-label').at(1).trigger('click'); return wrapper.vm.$nextTick().then(() => { const labels = wrapper.findAll('.deploy-project-label'); diff --git a/spec/frontend/deploy_keys/components/keys_panel_spec.js b/spec/frontend/deploy_keys/components/keys_panel_spec.js index 53c8ba073bc..34b592017e9 100644 --- a/spec/frontend/deploy_keys/components/keys_panel_spec.js +++ b/spec/frontend/deploy_keys/components/keys_panel_spec.js @@ -8,7 +8,7 @@ describe('Deploy keys panel', () => { const findTableRowHeader = () => wrapper.find('.table-row-header'); - const mountComponent = props => { + const mountComponent = (props) => { const store = new DeployKeysStore(); store.keys = data; wrapper = mount(deployKeysPanel, { @@ -48,12 +48,9 @@ describe('Deploy keys panel', () => { expect(wrapper.find('.settings-message').exists()).toBe(true); - expect( - wrapper - .find('.settings-message') - .text() - .trim(), - ).toBe('No deploy keys found. Create one with the form above.'); + expect(wrapper.find('.settings-message').text().trim()).toBe( + 'No deploy keys found. Create one with the form above.', + ); }); it('renders no table header if keys are empty', () => { -- cgit v1.2.1