Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/usage_quotas/storage')
-rw-r--r--spec/frontend/usage_quotas/storage/components/namespace_storage_app_spec.js14
-rw-r--r--spec/frontend/usage_quotas/storage/components/storage_usage_overview_card_spec.js6
-rw-r--r--spec/frontend/usage_quotas/storage/components/storage_usage_statistics_spec.js5
-rw-r--r--spec/frontend/usage_quotas/storage/mock_data.js6
4 files changed, 17 insertions, 14 deletions
diff --git a/spec/frontend/usage_quotas/storage/components/namespace_storage_app_spec.js b/spec/frontend/usage_quotas/storage/components/namespace_storage_app_spec.js
index 544666ddc5d..f9bc3d4da85 100644
--- a/spec/frontend/usage_quotas/storage/components/namespace_storage_app_spec.js
+++ b/spec/frontend/usage_quotas/storage/components/namespace_storage_app_spec.js
@@ -4,20 +4,16 @@ import NamespaceStorageApp from '~/usage_quotas/storage/components/namespace_sto
import StorageUsageStatistics from '~/usage_quotas/storage/components/storage_usage_statistics.vue';
import DependencyProxyUsage from '~/usage_quotas/storage/components/dependency_proxy_usage.vue';
import ContainerRegistryUsage from '~/usage_quotas/storage/components/container_registry_usage.vue';
-import { defaultNamespaceProvideValues } from '../mock_data';
+import {
+ defaultNamespaceProvideValues,
+ mockGetNamespaceStorageGraphQLResponse,
+} from '../mock_data';
const defaultProps = {
namespaceLoadingError: false,
projectsLoadingError: false,
isNamespaceStorageStatisticsLoading: false,
- // hardcoding object until we move test_fixtures from ee/ to here
- namespace: {
- rootStorageStatistics: {
- storageSize: 1234,
- containerRegistrySize: 111,
- containerRegistrySizeIsEstimated: false,
- },
- },
+ namespace: mockGetNamespaceStorageGraphQLResponse.data.namespace,
};
describe('NamespaceStorageApp', () => {
diff --git a/spec/frontend/usage_quotas/storage/components/storage_usage_overview_card_spec.js b/spec/frontend/usage_quotas/storage/components/storage_usage_overview_card_spec.js
index c79b6b94ac1..2dde568b1d2 100644
--- a/spec/frontend/usage_quotas/storage/components/storage_usage_overview_card_spec.js
+++ b/spec/frontend/usage_quotas/storage/components/storage_usage_overview_card_spec.js
@@ -3,14 +3,14 @@ import { numberToHumanSize } from '~/lib/utils/number_utils';
import StorageUsageOverviewCard from '~/usage_quotas/storage/components/storage_usage_overview_card.vue';
import NumberToHumanSize from '~/vue_shared/components/number_to_human_size/number_to_human_size.vue';
import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
+import { mockGetNamespaceStorageGraphQLResponse } from '../mock_data';
describe('StorageUsageOverviewCard', () => {
/** @type {import('helpers/vue_test_utils_helper').ExtendedWrapper} */
let wrapper;
const defaultProps = {
- purchasedStorage: 0,
- // hardcoding value until we move test_fixtures from ee/ to here
- usedStorage: 1234,
+ usedStorage:
+ mockGetNamespaceStorageGraphQLResponse.data.namespace.rootStorageStatistics.storageSize,
loading: false,
};
diff --git a/spec/frontend/usage_quotas/storage/components/storage_usage_statistics_spec.js b/spec/frontend/usage_quotas/storage/components/storage_usage_statistics_spec.js
index 73d02dc273f..bb96a12aaf2 100644
--- a/spec/frontend/usage_quotas/storage/components/storage_usage_statistics_spec.js
+++ b/spec/frontend/usage_quotas/storage/components/storage_usage_statistics_spec.js
@@ -1,10 +1,11 @@
import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import StorageUsageStatistics from '~/usage_quotas/storage/components/storage_usage_statistics.vue';
import StorageUsageOverviewCard from '~/usage_quotas/storage/components/storage_usage_overview_card.vue';
+import { mockGetNamespaceStorageGraphQLResponse } from '../mock_data';
const defaultProps = {
- // hardcoding value until we move test_fixtures from ee/ to here
- usedStorage: 1234,
+ usedStorage:
+ mockGetNamespaceStorageGraphQLResponse.data.namespace.rootStorageStatistics.storageSize,
loading: false,
};
diff --git a/spec/frontend/usage_quotas/storage/mock_data.js b/spec/frontend/usage_quotas/storage/mock_data.js
index 7847ddbe0a4..e7886614575 100644
--- a/spec/frontend/usage_quotas/storage/mock_data.js
+++ b/spec/frontend/usage_quotas/storage/mock_data.js
@@ -1,6 +1,11 @@
import mockGetProjectStorageStatisticsGraphQLResponse from 'test_fixtures/graphql/usage_quotas/storage/project_storage.query.graphql.json';
+import mockGetNamespaceStorageGraphQLResponse from 'test_fixtures/graphql/usage_quotas/storage/namespace_storage.query.graphql.json';
+import mockGetProjectListStorageGraphQLResponse from 'test_fixtures/graphql/usage_quotas/storage/project_list_storage.query.graphql.json';
export { mockGetProjectStorageStatisticsGraphQLResponse };
+export { mockGetNamespaceStorageGraphQLResponse };
+export { mockGetProjectListStorageGraphQLResponse };
+
export const mockEmptyResponse = { data: { project: null } };
export const defaultProjectProvideValues = {
@@ -9,4 +14,5 @@ export const defaultProjectProvideValues = {
export const defaultNamespaceProvideValues = {
userNamespace: false,
+ namespaceId: '42',
};