diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-24 21:11:44 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-24 21:11:44 +0300 |
commit | fd247970cfe1e98276c780fbdcca026b7960e42a (patch) | |
tree | ab7963eb9b30fd73283c526cb6ae4ca1ef61c06f /spec/frontend/usage_quotas | |
parent | df9890e9a702e2f12bbc8f022b916ca72820a292 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/usage_quotas')
-rw-r--r-- | spec/frontend/usage_quotas/components/usage_quotas_app_spec.js | 39 | ||||
-rw-r--r-- | spec/frontend/usage_quotas/mock_data.js | 3 |
2 files changed, 42 insertions, 0 deletions
diff --git a/spec/frontend/usage_quotas/components/usage_quotas_app_spec.js b/spec/frontend/usage_quotas/components/usage_quotas_app_spec.js new file mode 100644 index 00000000000..cb70ea4e72d --- /dev/null +++ b/spec/frontend/usage_quotas/components/usage_quotas_app_spec.js @@ -0,0 +1,39 @@ +import { GlSprintf } from '@gitlab/ui'; +import { shallowMountExtended } from 'helpers/vue_test_utils_helper'; +import UsageQuotasApp from '~/usage_quotas/components/usage_quotas_app.vue'; +import { USAGE_QUOTAS_TITLE } from '~/usage_quotas/constants'; +import { defaultProvide } from '../mock_data'; + +describe('UsageQuotasApp', () => { + let wrapper; + + const createComponent = ({ provide = {} } = {}) => { + wrapper = shallowMountExtended(UsageQuotasApp, { + provide: { + ...defaultProvide, + ...provide, + }, + stubs: { + GlSprintf, + }, + }); + }; + + beforeEach(() => { + createComponent(); + }); + + afterEach(() => { + wrapper.destroy(); + }); + + const findSubTitle = () => wrapper.findByTestId('usage-quotas-page-subtitle'); + + it('renders the view title', () => { + expect(wrapper.text()).toContain(USAGE_QUOTAS_TITLE); + }); + + it('renders the view subtitle', () => { + expect(findSubTitle().text()).toContain(defaultProvide.namespaceName); + }); +}); diff --git a/spec/frontend/usage_quotas/mock_data.js b/spec/frontend/usage_quotas/mock_data.js new file mode 100644 index 00000000000..a9d2a7ad1db --- /dev/null +++ b/spec/frontend/usage_quotas/mock_data.js @@ -0,0 +1,3 @@ +export const defaultProvide = { + namespaceName: 'Group 1', +}; |