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>2021-05-06 12:18:56 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-05-06 12:18:56 +0300
commitc06178d51ad9b8d4ce665047873615facfc9c1c5 (patch)
tree2a1acfea73fd0fbdd7d0e240fd7ac52224845f99 /spec/frontend/whats_new
parent0a0e8803b0e3e2fb83d74c9bafc32f4e9d825bcc (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/whats_new')
-rw-r--r--spec/frontend/whats_new/components/feature_spec.js46
1 files changed, 46 insertions, 0 deletions
diff --git a/spec/frontend/whats_new/components/feature_spec.js b/spec/frontend/whats_new/components/feature_spec.js
new file mode 100644
index 00000000000..9e9cb59c0d6
--- /dev/null
+++ b/spec/frontend/whats_new/components/feature_spec.js
@@ -0,0 +1,46 @@
+import { shallowMount } from '@vue/test-utils';
+import Feature from '~/whats_new/components/feature.vue';
+
+describe("What's new single feature", () => {
+ /** @type {import("@vue/test-utils").Wrapper} */
+ let wrapper;
+
+ const exampleFeature = {
+ title: 'Compliance pipeline configurations',
+ body:
+ '<p>We are thrilled to announce that it is now possible to define enforceable pipelines that will run for any project assigned a corresponding compliance framework.</p>',
+ stage: 'Manage',
+ 'self-managed': true,
+ 'gitlab-com': true,
+ packages: ['Ultimate'],
+ url: 'https://docs.gitlab.com/ee/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',
+ release: '13.11',
+ };
+
+ const findReleaseDate = () => wrapper.find('[data-testid="release-date"]');
+
+ const createWrapper = ({ feature } = {}) => {
+ wrapper = shallowMount(Feature, {
+ propsData: { feature },
+ });
+ };
+
+ afterEach(() => {
+ wrapper.destroy();
+ wrapper = null;
+ });
+
+ it('renders the date', () => {
+ createWrapper({ feature: exampleFeature });
+ expect(findReleaseDate().text()).toBe('April 22, 2021');
+ });
+
+ describe('when the published_at is null', () => {
+ it("doesn't render the date", () => {
+ createWrapper({ feature: { ...exampleFeature, published_at: null } });
+ expect(findReleaseDate().exists()).toBe(false);
+ });
+ });
+});