Commit 59d74b5c authored by Phil Hughes's avatar Phil Hughes

Merge branch 'ek-fix-deep-linking-vsa-stages' into 'master'

Fix stage table loading with a deep linked stage

See merge request gitlab-org/gitlab!60261
parents e8e4b6dd a3fea5d9
...@@ -55,11 +55,11 @@ export default { ...@@ -55,11 +55,11 @@ export default {
}, },
isDefaultTestStage() { isDefaultTestStage() {
const { currentStage } = this; const { currentStage } = this;
return !currentStage.custom && currentStage.name.toLowerCase().trim() === 'test'; return !currentStage.custom && currentStage.title?.toLowerCase().trim() === 'test';
}, },
isDefaultStagingStage() { isDefaultStagingStage() {
const { currentStage } = this; const { currentStage } = this;
return !currentStage.custom && currentStage.name.toLowerCase().trim() === 'staging'; return !currentStage.custom && currentStage.title?.toLowerCase().trim() === 'staging';
}, },
isMergeRequestStage() { isMergeRequestStage() {
const [firstEvent] = this.stageEvents; 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', () => { ...@@ -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', () => { describe('default event', () => {
beforeEach(() => { beforeEach(() => {
wrapper = createComponent({ 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