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-03-26 00:09:13 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-03-26 00:09:13 +0300
commit659ad26b4e0e1f792ab6d15ac8d6e47ec943e214 (patch)
tree5e395d172b681cfe396c671ebf7eef8789ef7334 /spec/frontend/pipelines/time_ago_spec.js
parente93121b42cb4ca672c893c6be0a8af0c8d9f7987 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/pipelines/time_ago_spec.js')
-rw-r--r--spec/frontend/pipelines/time_ago_spec.js65
1 files changed, 9 insertions, 56 deletions
diff --git a/spec/frontend/pipelines/time_ago_spec.js b/spec/frontend/pipelines/time_ago_spec.js
index 412fb085e0b..5c174c436fe 100644
--- a/spec/frontend/pipelines/time_ago_spec.js
+++ b/spec/frontend/pipelines/time_ago_spec.js
@@ -5,41 +5,6 @@ import TimeAgo from '~/pipelines/components/pipelines_list/time_ago.vue';
describe('Timeago component', () => {
let wrapper;
- const mutlipleStages = {
- manual_actions: [
- {
- name: 'deploy_job',
- path: '/root/one-stage-manual/-/jobs/1930/play',
- playable: true,
- scheduled: false,
- },
- ],
- stages: [
- {
- name: 'deploy',
- },
- {
- name: 'qa',
- },
- ],
- };
-
- const singleStageManual = {
- manual_actions: [
- {
- name: 'deploy_job',
- path: '/root/one-stage-manual/-/jobs/1930/play',
- playable: true,
- scheduled: false,
- },
- ],
- stages: [
- {
- name: 'deploy',
- },
- ],
- };
-
const createComponent = (props = {}) => {
wrapper = shallowMount(TimeAgo, {
propsData: {
@@ -82,7 +47,7 @@ describe('Timeago component', () => {
describe('without duration', () => {
beforeEach(() => {
- createComponent({ ...singleStageManual, duration: 0, finished_at: '' });
+ createComponent({ duration: 0, finished_at: '' });
});
it('should not render duration and timer svg', () => {
@@ -107,7 +72,7 @@ describe('Timeago component', () => {
describe('without finishedTime', () => {
beforeEach(() => {
- createComponent({ ...singleStageManual, duration: 0, finished_at: '' });
+ createComponent({ duration: 0, finished_at: '' });
});
it('should not render time and calendar icon', () => {
@@ -126,7 +91,6 @@ describe('Timeago component', () => {
'progress state shown: $shouldShow when pipeline duration is $durationTime and finished_at is $finishedAtTime',
({ durationTime, finishedAtTime, shouldShow }) => {
createComponent({
- ...mutlipleStages,
duration: durationTime,
finished_at: finishedAtTime,
});
@@ -138,24 +102,13 @@ describe('Timeago component', () => {
});
describe('skipped', () => {
- it.each`
- durationTime | finishedAtTime | shouldShow
- ${10} | ${'2017-04-26T12:40:23.277Z'} | ${false}
- ${10} | ${''} | ${false}
- ${0} | ${'2017-04-26T12:40:23.277Z'} | ${false}
- ${0} | ${''} | ${true}
- `(
- 'progress state shown: $shouldShow when pipeline duration is $durationTime and finished_at is $finishedAtTime',
- ({ durationTime, finishedAtTime, shouldShow }) => {
- createComponent({
- ...singleStageManual,
- duration: durationTime,
- finished_at: finishedAtTime,
- });
+ it('should show skipped if pipeline was skipped', () => {
+ createComponent({
+ status: { label: 'skipped' },
+ });
- expect(findSkipped().exists()).toBe(shouldShow);
- expect(findInProgress().exists()).toBe(false);
- },
- );
+ expect(findSkipped().exists()).toBe(true);
+ expect(findInProgress().exists()).toBe(false);
+ });
});
});