diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-27 18:10:15 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-27 18:10:15 +0300 |
commit | 9979d2afd66e12d938ea55372dcf2d8105b5eaca (patch) | |
tree | 88df8f6a2f2ffba2fa1318dee83f58d6fe76d40d /spec/frontend | |
parent | fdf32113c3924f7faec91101282fc28ec42fc869 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend')
4 files changed, 19 insertions, 34 deletions
diff --git a/spec/frontend/access_tokens/components/access_token_table_app_spec.js b/spec/frontend/access_tokens/components/access_token_table_app_spec.js index 2fa14810578..5236f38dc35 100644 --- a/spec/frontend/access_tokens/components/access_token_table_app_spec.js +++ b/spec/frontend/access_tokens/components/access_token_table_app_spec.js @@ -91,24 +91,6 @@ describe('~/access_tokens/components/access_token_table_app', () => { expect(cells.at(0).text()).toBe(noTokensMessage); }); - it('should show a title indicating the amount of tokens', () => { - createComponent(); - - expect(wrapper.find('h5').text()).toBe( - sprintf(__('Active %{accessTokenTypePlural} (%{totalAccessTokens})'), { - accessTokenTypePlural, - totalAccessTokens: defaultActiveAccessTokens.length, - }), - ); - }); - - it('should render information section', () => { - const info = 'This is my information'; - createComponent({ information: info }); - - expect(wrapper.findByTestId('information-section').text()).toBe(info); - }); - describe('table headers', () => { it('should include `Action` column', () => { createComponent(); diff --git a/spec/frontend/access_tokens/components/new_access_token_app_spec.js b/spec/frontend/access_tokens/components/new_access_token_app_spec.js index 70f77932ccf..d51ac638f0e 100644 --- a/spec/frontend/access_tokens/components/new_access_token_app_spec.js +++ b/spec/frontend/access_tokens/components/new_access_token_app_spec.js @@ -23,6 +23,8 @@ describe('~/access_tokens/components/new_access_token_app', () => { }; const findButtonEl = () => document.querySelector('[type=submit]'); + const findGlAlertError = () => wrapper.findByTestId('error-message'); + const findGlAlertSuccess = () => wrapper.findByTestId('success-message'); const triggerSuccess = async (newToken = 'new token') => { wrapper @@ -57,7 +59,7 @@ describe('~/access_tokens/components/new_access_token_app', () => { it('should render nothing', () => { expect(wrapper.findComponent(InputCopyToggleVisibility).exists()).toBe(false); - expect(wrapper.findComponent(GlAlert).exists()).toBe(false); + expect(findGlAlertError().exists()).toBe(false); }); describe('on success', () => { @@ -65,7 +67,8 @@ describe('~/access_tokens/components/new_access_token_app', () => { const newToken = '12345'; await triggerSuccess(newToken); - expect(wrapper.findComponent(GlAlert).exists()).toBe(false); + expect(findGlAlertError().exists()).toBe(false); + expect(findGlAlertSuccess().exists()).toBe(true); const InputCopyToggleVisibilityComponent = wrapper.findComponent(InputCopyToggleVisibility); expect(InputCopyToggleVisibilityComponent.props('value')).toBe(newToken); @@ -82,7 +85,7 @@ describe('~/access_tokens/components/new_access_token_app', () => { const newToken = '12345'; await triggerSuccess(newToken); - expect(wrapper.findComponent(GlAlert).exists()).toBe(false); + expect(findGlAlertError().exists()).toBe(false); const inputAttributes = wrapper .findByLabelText(sprintf(__('Your new %{accessTokenType}'), { accessTokenType })) @@ -135,7 +138,7 @@ describe('~/access_tokens/components/new_access_token_app', () => { expect(wrapper.findComponent(InputCopyToggleVisibility).exists()).toBe(false); - let GlAlertComponent = wrapper.findComponent(GlAlert); + let GlAlertComponent = findGlAlertError(); expect(GlAlertComponent.props('title')).toBe(__('The form contains the following errors:')); expect(GlAlertComponent.props('variant')).toBe('danger'); let itemEls = wrapper.findAll('li'); diff --git a/spec/frontend/access_tokens/index_spec.js b/spec/frontend/access_tokens/index_spec.js index c1158e0d124..7d4d73b00b2 100644 --- a/spec/frontend/access_tokens/index_spec.js +++ b/spec/frontend/access_tokens/index_spec.js @@ -50,7 +50,6 @@ describe('access tokens', () => { initialActiveAccessTokens, // Default values - information: undefined, noActiveTokensMessage: sprintf(__('This user has no active %{accessTokenTypePlural}.'), { accessTokenTypePlural, }), @@ -59,14 +58,12 @@ describe('access tokens', () => { }); it('mounts the component and provides all values', () => { - const information = 'Additional information'; const noActiveTokensMessage = 'This group has no active access tokens.'; setHTMLFixture( `<div id="js-access-token-table-app" data-access-token-type="${accessTokenType}" data-access-token-type-plural="${accessTokenTypePlural}" data-initial-active-access-tokens=${JSON.stringify(initialActiveAccessTokens)} - data-information="${information}" data-no-active-tokens-message="${noActiveTokensMessage}" data-show-role > @@ -82,7 +79,6 @@ describe('access tokens', () => { accessTokenType, accessTokenTypePlural, initialActiveAccessTokens, - information, noActiveTokensMessage, showRole: true, }); diff --git a/spec/frontend/vue_merge_request_widget/components/widget/__snapshots__/dynamic_content_spec.js.snap b/spec/frontend/vue_merge_request_widget/components/widget/__snapshots__/dynamic_content_spec.js.snap index bb520cd7a47..9c5f9db9762 100644 --- a/spec/frontend/vue_merge_request_widget/components/widget/__snapshots__/dynamic_content_spec.js.snap +++ b/spec/frontend/vue_merge_request_widget/components/widget/__snapshots__/dynamic_content_spec.js.snap @@ -18,10 +18,12 @@ exports[`~/vue_merge_request_widget/components/widget/dynamic_content.vue render <status-icon-stub level=\\"2\\" name=\\"MyWidget\\" iconname=\\"success\\"></status-icon-stub> <div class=\\"gl-w-full gl-display-flex\\"> <div class=\\"gl-display-flex gl-flex-grow-1\\"> - <div class=\\"gl-display-flex gl-flex-grow-1 gl-flex-direction-column\\"> - <p class=\\"gl-mb-0 gl-mr-1\\">Main text for the row</p> - <gl-link-stub href=\\"https://gitlab.com\\">Optional link to display after text</gl-link-stub> - <!----> + <div class=\\"gl-display-flex gl-flex-grow-1 gl-align-items-baseline\\"> + <div> + <p class=\\"gl-mb-0 gl-mr-1\\">Main text for the row</p> + <gl-link-stub href=\\"https://gitlab.com\\">Optional link to display after text</gl-link-stub> + <!----> + </div> <gl-badge-stub size=\\"md\\" variant=\\"info\\" iconsize=\\"md\\"> Badge is optional. Text to be displayed inside badge </gl-badge-stub> @@ -44,10 +46,12 @@ exports[`~/vue_merge_request_widget/components/widget/dynamic_content.vue render <!----> <div class=\\"gl-w-full gl-display-flex\\"> <div class=\\"gl-display-flex gl-flex-grow-1\\"> - <div class=\\"gl-display-flex gl-flex-grow-1 gl-flex-direction-column\\"> - <p class=\\"gl-mb-0 gl-mr-1\\">This is recursive. It will be listed in level 3.</p> - <!----> - <!----> + <div class=\\"gl-display-flex gl-flex-grow-1 gl-align-items-baseline\\"> + <div> + <p class=\\"gl-mb-0 gl-mr-1\\">This is recursive. It will be listed in level 3.</p> + <!----> + <!----> + </div> <!----> </div> <actions-stub widget=\\"MyWidget\\" tertiarybuttons=\\"\\" class=\\"gl-ml-auto gl-pl-3\\"></actions-stub> |