Commit 63ac798a authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Merge branch 'afontaine/fix-upcoming-deployment-test' into 'master'

Add test for displaying the upcoming development

See merge request gitlab-org/gitlab!78309
parents 185094d8 aec91817
...@@ -294,7 +294,7 @@ describe('~/environments/components/new_environment_item.vue', () => { ...@@ -294,7 +294,7 @@ describe('~/environments/components/new_environment_item.vue', () => {
const deployment = findDeployment(); const deployment = findDeployment();
expect(deployment.props('deployment')).toEqual(resolvedEnvironment.lastDeployment); expect(deployment.props('deployment')).toEqual(resolvedEnvironment.lastDeployment);
}); });
it('should not show the last deployment to the deployment component when it is missing', () => { it('should not show the last deployment when it is missing', () => {
const environment = { const environment = {
...resolvedEnvironment, ...resolvedEnvironment,
lastDeployment: null, lastDeployment: null,
...@@ -309,4 +309,33 @@ describe('~/environments/components/new_environment_item.vue', () => { ...@@ -309,4 +309,33 @@ describe('~/environments/components/new_environment_item.vue', () => {
expect(deployment.exists()).toBe(false); expect(deployment.exists()).toBe(false);
}); });
}); });
describe('upcoming deployment', () => {
it('should pass the upcoming deployment to the deployment component when it exists', () => {
const upcomingDeployment = resolvedEnvironment.lastDeployment;
const environment = { ...resolvedEnvironment, lastDeployment: null, upcomingDeployment };
wrapper = createWrapper({
propsData: { environment },
apolloProvider: createApolloProvider(),
});
const deployment = findDeployment();
expect(deployment.props('deployment')).toEqual(upcomingDeployment);
});
it('should not show the upcoming deployment when it is missing', () => {
const environment = {
...resolvedEnvironment,
lastDeployment: null,
upcomingDeployment: null,
};
wrapper = createWrapper({
propsData: { environment },
apolloProvider: createApolloProvider(),
});
const deployment = findDeployment();
expect(deployment.exists()).toBe(false);
});
});
}); });
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