Commit a3fea5d9 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Fix stage table loading with a deep linked stage

The title field is populated for stages from the
BE when deep linking to a stage, we should use that
to compare the stage when setting the table title

Test the stage table with minimal stage data

Changelog: fixed
parent 95a2fd1a
......@@ -55,11 +55,11 @@ export default {
},
isDefaultTestStage() {
const { currentStage } = this;
return !currentStage.custom && currentStage.name.toLowerCase().trim() === 'test';
return !currentStage.custom && currentStage.title?.toLowerCase().trim() === 'test';
},
isDefaultStagingStage() {
const { currentStage } = this;
return !currentStage.custom && currentStage.name.toLowerCase().trim() === 'staging';
return !currentStage.custom && currentStage.title?.toLowerCase().trim() === 'staging';
},
isMergeRequestStage() {
const [firstEvent] = this.stageEvents;
......
---
title: Fix stage table loading with a deep linked stage
merge_request: 60261
author:
type: fixed
......@@ -70,6 +70,22 @@ describe('StageTable', () => {
});
});
describe('with minimal stage data', () => {
beforeEach(() => {
wrapper = createComponent({ currentStage: { title: 'New stage title' } });
});
it('will render the correct events', () => {
const evs = findStageEvents();
expect(evs).toHaveLength(issueEvents.length);
const titles = evs.wrappers.map((ev) => findStageEventTitle(ev).text());
issueEvents.forEach((ev, index) => {
expect(titles[index]).toBe(ev.title);
});
});
});
describe('default event', () => {
beforeEach(() => {
wrapper = createComponent({
......
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