diff options
Diffstat (limited to 'spec/frontend/whats_new/components')
-rw-r--r-- | spec/frontend/whats_new/components/app_spec.js | 1 | ||||
-rw-r--r-- | spec/frontend/whats_new/components/feature_spec.js | 23 |
2 files changed, 21 insertions, 3 deletions
diff --git a/spec/frontend/whats_new/components/app_spec.js b/spec/frontend/whats_new/components/app_spec.js index b74473b5494..c0954ac1133 100644 --- a/spec/frontend/whats_new/components/app_spec.js +++ b/spec/frontend/whats_new/components/app_spec.js @@ -1,6 +1,7 @@ import { GlDrawer, GlInfiniteScroll } from '@gitlab/ui'; import { mount } from '@vue/test-utils'; import Vue, { nextTick } from 'vue'; +// eslint-disable-next-line no-restricted-imports import Vuex from 'vuex'; import { mockTracking, unmockTracking, triggerEvent } from 'helpers/tracking_helper'; import { createMockDirective, getBinding } from 'helpers/vue_mock_directive'; diff --git a/spec/frontend/whats_new/components/feature_spec.js b/spec/frontend/whats_new/components/feature_spec.js index d69ac2803df..a51bb507285 100644 --- a/spec/frontend/whats_new/components/feature_spec.js +++ b/spec/frontend/whats_new/components/feature_spec.js @@ -1,5 +1,7 @@ import { shallowMount } from '@vue/test-utils'; +import timezoneMock from 'timezone-mock'; import Feature from '~/whats_new/components/feature.vue'; +import { DOCS_URL_IN_EE_DIR } from 'jh_else_ce/lib/utils/url_utility'; describe("What's new single feature", () => { /** @type {import("@vue/test-utils").Wrapper} */ @@ -13,10 +15,9 @@ describe("What's new single feature", () => { 'self-managed': true, 'gitlab-com': true, available_in: ['Ultimate'], - documentation_link: - 'https://docs.gitlab.com/ee/user/project/settings/#compliance-pipeline-configuration', + documentation_link: `${DOCS_URL_IN_EE_DIR}/user/project/settings/#compliance-pipeline-configuration`, image_url: 'https://img.youtube.com/vi/upLJ_equomw/hqdefault.jpg', - published_at: '2021-04-22T00:00:00.000Z', + published_at: '2021-04-22', release: '13.11', }; @@ -53,6 +54,22 @@ describe("What's new single feature", () => { }); }); + describe('when the user is in a time zone West of UTC', () => { + beforeEach(() => { + timezoneMock.register('US/Pacific'); + }); + + afterEach(() => { + timezoneMock.unregister(); + }); + + it('renders the date', () => { + createWrapper({ feature: exampleFeature }); + + expect(findReleaseDate().text()).toBe('April 22, 2021'); + }); + }); + describe('when image_url is null', () => { it('does not render image link', () => { createWrapper({ feature: { ...exampleFeature, image_url: null } }); |