Commit 4301dcc3 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'vs-backport-fixes-for-jest-twenty-six' into 'master'

Backport spec fixes for upcoming upgrade to Jest 26

See merge request gitlab-org/gitlab!39090
parents 228955f1 be71ec68
...@@ -45,7 +45,7 @@ export default { ...@@ -45,7 +45,7 @@ export default {
<gl-skeleton-loading v-if="isLoading" class="gl-h-auto gl-py-3" /> <gl-skeleton-loading v-if="isLoading" class="gl-h-auto gl-py-3" />
<div v-else ref="metricsWrapper" class="gl-display-flex"> <div v-else ref="metricsWrapper" class="gl-display-flex">
<div <div
v-for="{ tooltipText = '', ...metric } in metrics" v-for="metric in metrics"
:key="metric.key" :key="metric.key"
ref="metricItem" ref="metricItem"
class="js-metric-card-item gl-flex-grow-1 gl-text-center" class="js-metric-card-item gl-flex-grow-1 gl-text-center"
...@@ -56,14 +56,16 @@ export default { ...@@ -56,14 +56,16 @@ export default {
<h3 v-else class="gl-my-2">{{ valueText(metric) }}</h3> <h3 v-else class="gl-my-2">{{ valueText(metric) }}</h3>
<p class="text-secondary gl-font-sm gl-mb-2"> <p class="text-secondary gl-font-sm gl-mb-2">
{{ metric.label }} {{ metric.label }}
<span v-if="tooltipText.length" <span v-if="metric.tooltipText">
>&nbsp;<gl-icon &nbsp;
v-gl-tooltip="{ title: tooltipText }" <gl-icon
v-gl-tooltip="{ title: metric.tooltipText }"
:size="14" :size="14"
class="gl-vertical-align-middle" class="gl-vertical-align-middle"
name="question" name="question"
data-testid="tooltip" data-testid="tooltip"
/></span> />
</span>
</p> </p>
</div> </div>
</div> </div>
......
...@@ -72,7 +72,7 @@ describe('Vulnerability state dropdown component', () => { ...@@ -72,7 +72,7 @@ describe('Vulnerability state dropdown component', () => {
}); });
describe('tests that use the default wrapper', () => { describe('tests that use the default wrapper', () => {
beforeEach(createWrapper); beforeEach(() => createWrapper());
it('the save button should be enabled/disabled based on if the selected item has changed or not', () => { it('the save button should be enabled/disabled based on if the selected item has changed or not', () => {
const originalItem = selectedItem(); const originalItem = selectedItem();
......
...@@ -13,7 +13,7 @@ import { ...@@ -13,7 +13,7 @@ import {
SET_TAGS_LIST_SUCCESS, SET_TAGS_LIST_SUCCESS,
SET_TAGS_PAGINATION, SET_TAGS_PAGINATION,
SET_INITIAL_STATE, SET_INITIAL_STATE,
} from '~/registry/explorer/stores/mutation_types/'; } from '~/registry/explorer/stores/mutation_types';
import { tagsListResponse } from '../mock_data'; import { tagsListResponse } from '../mock_data';
import { DeleteModal } from '../stubs'; import { DeleteModal } from '../stubs';
......
...@@ -14,7 +14,7 @@ import { ...@@ -14,7 +14,7 @@ import {
SET_IMAGES_LIST_SUCCESS, SET_IMAGES_LIST_SUCCESS,
SET_PAGINATION, SET_PAGINATION,
SET_INITIAL_STATE, SET_INITIAL_STATE,
} from '~/registry/explorer/stores/mutation_types/'; } from '~/registry/explorer/stores/mutation_types';
import { import {
DELETE_IMAGE_SUCCESS_MESSAGE, DELETE_IMAGE_SUCCESS_MESSAGE,
DELETE_IMAGE_ERROR_MESSAGE, DELETE_IMAGE_ERROR_MESSAGE,
......
...@@ -25,7 +25,7 @@ describe('Identicon', () => { ...@@ -25,7 +25,7 @@ describe('Identicon', () => {
}); });
describe('entity id is a number', () => { describe('entity id is a number', () => {
beforeEach(createComponent); beforeEach(() => createComponent());
it('matches snapshot', () => { it('matches snapshot', () => {
expect(wrapper.element).toMatchSnapshot(); expect(wrapper.element).toMatchSnapshot();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment