diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-15 15:07:44 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-15 15:07:44 +0300 |
commit | 6a9ab27963fc1479fe7c78581b942c8dcce322e5 (patch) | |
tree | 8d32f4f66efde1b426658a74d0276e5250091ab7 /spec/frontend/google_cloud | |
parent | 389d5aa505a916b0506b7b73dcc3be342d724976 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/google_cloud')
-rw-r--r-- | spec/frontend/google_cloud/components/app_spec.js | 1 | ||||
-rw-r--r-- | spec/frontend/google_cloud/components/home_spec.js | 1 | ||||
-rw-r--r-- | spec/frontend/google_cloud/components/revoke_oauth_spec.js | 47 |
3 files changed, 49 insertions, 0 deletions
diff --git a/spec/frontend/google_cloud/components/app_spec.js b/spec/frontend/google_cloud/components/app_spec.js index 70d33ff67f1..50b05fb30e0 100644 --- a/spec/frontend/google_cloud/components/app_spec.js +++ b/spec/frontend/google_cloud/components/app_spec.js @@ -28,6 +28,7 @@ const HOME_PROPS = { emptyIllustrationUrl: '#url-empty-illustration', enableCloudRunUrl: '#url-enable-cloud-run', enableCloudStorageUrl: '#enableCloudStorageUrl', + revokeOauthUrl: '#revokeOauthUrl', }; describe('google_cloud App component', () => { diff --git a/spec/frontend/google_cloud/components/home_spec.js b/spec/frontend/google_cloud/components/home_spec.js index 1ce97097374..42e3d72577d 100644 --- a/spec/frontend/google_cloud/components/home_spec.js +++ b/spec/frontend/google_cloud/components/home_spec.js @@ -24,6 +24,7 @@ describe('google_cloud Home component', () => { emptyIllustrationUrl: '#url-empty-illustration', enableCloudRunUrl: '#url-enable-cloud-run', enableCloudStorageUrl: '#enableCloudStorageUrl', + revokeOauthUrl: '#revokeOauthUrl', }; beforeEach(() => { diff --git a/spec/frontend/google_cloud/components/revoke_oauth_spec.js b/spec/frontend/google_cloud/components/revoke_oauth_spec.js new file mode 100644 index 00000000000..87580dbf6de --- /dev/null +++ b/spec/frontend/google_cloud/components/revoke_oauth_spec.js @@ -0,0 +1,47 @@ +import { shallowMount } from '@vue/test-utils'; +import { GlButton, GlForm } from '@gitlab/ui'; +import RevokeOauth, { + GOOGLE_CLOUD_REVOKE_TITLE, + GOOGLE_CLOUD_REVOKE_DESCRIPTION, +} from '~/google_cloud/components/revoke_oauth.vue'; + +describe('RevokeOauth component', () => { + let wrapper; + + const findTitle = () => wrapper.find('h2'); + const findDescription = () => wrapper.find('p'); + const findForm = () => wrapper.findComponent(GlForm); + const findButton = () => wrapper.findComponent(GlButton); + const propsData = { + url: 'url_general_feedback', + }; + + beforeEach(() => { + wrapper = shallowMount(RevokeOauth, { propsData }); + }); + + afterEach(() => { + wrapper.destroy(); + }); + + it('contains title', () => { + const title = findTitle(); + expect(title.text()).toContain('Revoke authorizations'); + }); + + it('contains description', () => { + const description = findDescription(); + expect(description.text()).toContain(GOOGLE_CLOUD_REVOKE_DESCRIPTION); + }); + + it('contains form', () => { + const form = findForm(); + expect(form.attributes('action')).toBe(propsData.url); + expect(form.attributes('method')).toBe('post'); + }); + + it('contains button', () => { + const button = findButton(); + expect(button.text()).toContain(GOOGLE_CLOUD_REVOKE_TITLE); + }); +}); |