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/ml/model_registry/graphql_mock_data.js')
-rw-r--r--spec/frontend/ml/model_registry/graphql_mock_data.js61
1 files changed, 61 insertions, 0 deletions
diff --git a/spec/frontend/ml/model_registry/graphql_mock_data.js b/spec/frontend/ml/model_registry/graphql_mock_data.js
index 27424fbf0df..b44963577bf 100644
--- a/spec/frontend/ml/model_registry/graphql_mock_data.js
+++ b/spec/frontend/ml/model_registry/graphql_mock_data.js
@@ -138,3 +138,64 @@ export const createModelResponses = {
},
},
};
+
+export const modelWithVersions = {
+ id: 'gid://gitlab/Ml::Model/1',
+ name: 'model_1',
+ versionCount: 2,
+ createdAt: '2023-12-06T12:41:48Z',
+ latestVersion: {
+ id: 'gid://gitlab/Ml::ModelVersion/1',
+ version: '1.0.0',
+ _links: {
+ showPath: '/my_project/-/ml/models/1/versions/1',
+ },
+ },
+ _links: {
+ showPath: '/my_project/-/ml/models/1',
+ },
+};
+
+export const modelWithOneVersion = {
+ id: 'gid://gitlab/Ml::Model/2',
+ name: 'model_2',
+ versionCount: 1,
+ createdAt: '2023-12-06T12:41:48Z',
+ latestVersion: {
+ id: 'gid://gitlab/Ml::ModelVersion/1',
+ version: '1.0.0',
+ _links: {
+ showPath: '/my_project/-/ml/models/2/versions/1',
+ },
+ },
+ _links: {
+ showPath: '/my_project/-/ml/models/2',
+ },
+};
+
+export const modelWithoutVersion = {
+ id: 'gid://gitlab/Ml::Model/3',
+ name: 'model_3',
+ versionCount: 0,
+ latestVersion: null,
+ createdAt: '2023-12-06T12:41:48Z',
+ _links: {
+ showPath: '/my_project/-/ml/models/3',
+ },
+};
+
+export const modelsQuery = (
+ models = [modelWithOneVersion, modelWithoutVersion],
+ pageInfo = graphqlPageInfo,
+) => ({
+ data: {
+ project: {
+ id: 'gid://gitlab/Project/1',
+ mlModels: {
+ count: models.length,
+ nodes: models,
+ pageInfo,
+ },
+ },
+ },
+});