summaryrefslogtreecommitdiff
path: root/spec/frontend/usage_quotas/components/usage_quotas_app_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/usage_quotas/components/usage_quotas_app_spec.js')
-rw-r--r--spec/frontend/usage_quotas/components/usage_quotas_app_spec.js39
1 files changed, 39 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);
+ });
+});