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:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-12-28 03:10:52 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-12-28 03:10:52 +0300
commit2a9fda3873be76cc9295d663e6157a071f2f882c (patch)
tree4743b51996f8f5de618044cb14ab6778676b0dab /spec/frontend
parentd099cb5be9c4fa93ba9a114d11ba6dbe5f10a4eb (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend')
-rw-r--r--spec/frontend/ml/model_registry/apps/show_ml_model_spec.js11
-rw-r--r--spec/frontend/ml/model_registry/mock_data.js1
2 files changed, 8 insertions, 4 deletions
diff --git a/spec/frontend/ml/model_registry/apps/show_ml_model_spec.js b/spec/frontend/ml/model_registry/apps/show_ml_model_spec.js
index 1fe0f5f88b3..7e991687496 100644
--- a/spec/frontend/ml/model_registry/apps/show_ml_model_spec.js
+++ b/spec/frontend/ml/model_registry/apps/show_ml_model_spec.js
@@ -1,7 +1,7 @@
import { GlBadge, GlTab } from '@gitlab/ui';
-import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
+import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import { ShowMlModel } from '~/ml/model_registry/apps';
import ModelVersionList from '~/ml/model_registry/components/model_version_list.vue';
import CandidateList from '~/ml/model_registry/components/candidate_list.vue';
@@ -19,7 +19,7 @@ let wrapper;
Vue.use(VueApollo);
const createWrapper = (model = MODEL) => {
- wrapper = shallowMount(ShowMlModel, {
+ wrapper = shallowMountExtended(ShowMlModel, {
apolloProvider,
propsData: { model },
stubs: { GlTab },
@@ -37,6 +37,7 @@ const findCandidatesCountBadge = () => findCandidateTab().findComponent(GlBadge)
const findTitleArea = () => wrapper.findComponent(TitleArea);
const findEmptyState = () => wrapper.findComponent(EmptyState);
const findVersionCountMetadataItem = () => findTitleArea().findComponent(MetadataItem);
+const findVersionLink = () => wrapper.findByTestId('model-version-link');
describe('ShowMlModel', () => {
describe('Title', () => {
@@ -67,8 +68,10 @@ describe('ShowMlModel', () => {
expect(findModelVersionDetail().props('modelVersion')).toBe(MODEL.latestVersion);
});
- it('displays the title', () => {
- expect(findDetailTab().text()).toContain('Latest version: 1.2.3');
+ it('displays a link to latest version', () => {
+ expect(findDetailTab().text()).toContain('Latest version:');
+ expect(findVersionLink().attributes('href')).toBe(MODEL.latestVersion.path);
+ expect(findVersionLink().text()).toBe('1.2.3');
});
});
diff --git a/spec/frontend/ml/model_registry/mock_data.js b/spec/frontend/ml/model_registry/mock_data.js
index 4399df38990..d8bb6a8eedb 100644
--- a/spec/frontend/ml/model_registry/mock_data.js
+++ b/spec/frontend/ml/model_registry/mock_data.js
@@ -42,6 +42,7 @@ export const newCandidate = () => ({
const LATEST_VERSION = {
version: '1.2.3',
+ path: 'path/to/modelversion',
};
export const makeModel = ({ latestVersion } = { latestVersion: LATEST_VERSION }) => ({