summaryrefslogtreecommitdiff
path: root/spec/frontend/environments/environment_table_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/environments/environment_table_spec.js')
-rw-r--r--spec/frontend/environments/environment_table_spec.js44
1 files changed, 40 insertions, 4 deletions
diff --git a/spec/frontend/environments/environment_table_spec.js b/spec/frontend/environments/environment_table_spec.js
index 863c4526bb9..71426ee5170 100644
--- a/spec/frontend/environments/environment_table_spec.js
+++ b/spec/frontend/environments/environment_table_spec.js
@@ -89,6 +89,42 @@ describe('Environment table', () => {
expect(wrapper.find('.deploy-board-icon').exists()).toBe(true);
});
+ it('should render deploy board container when data is provided for children', async () => {
+ const mockItem = {
+ name: 'review',
+ size: 1,
+ environment_path: 'url',
+ logs_path: 'url',
+ id: 1,
+ isFolder: true,
+ isOpen: true,
+ children: [
+ {
+ name: 'review/test',
+ hasDeployBoard: true,
+ deployBoardData: deployBoardMockData,
+ isDeployBoardVisible: true,
+ isLoadingDeployBoard: false,
+ isEmptyDeployBoard: false,
+ },
+ ],
+ };
+
+ await factory({
+ propsData: {
+ environments: [mockItem],
+ canCreateDeployment: false,
+ canReadEnvironment: true,
+ userCalloutsPath: '/callouts',
+ lockPromotionSvgPath: '/assets/illustrations/lock-promotion.svg',
+ helpCanaryDeploymentsPath: 'help/canary-deployments',
+ },
+ });
+
+ expect(wrapper.find('.js-deploy-board-row').exists()).toBe(true);
+ expect(wrapper.find('.deploy-board-icon').exists()).toBe(true);
+ });
+
it('should toggle deploy board visibility when arrow is clicked', (done) => {
const mockItem = {
name: 'review',
@@ -125,7 +161,7 @@ describe('Environment table', () => {
wrapper.find('.deploy-board-icon').trigger('click');
});
- it('should set the enviornment to change and weight when a change canary weight event is recevied', async () => {
+ it('should set the environment to change and weight when a change canary weight event is recevied', async () => {
const mockItem = {
name: 'review',
size: 1,
@@ -359,7 +395,7 @@ describe('Environment table', () => {
},
},
{
- name: 'review/master',
+ name: 'review/main',
last_deployment: {
created_at: '2019-02-17T16:26:15.125Z',
},
@@ -374,7 +410,7 @@ describe('Environment table', () => {
},
];
const [production, review, staging] = mockItems;
- const [addcibuildstatus, master] = mockItems[1].children;
+ const [addcibuildstatus, main] = mockItems[1].children;
factory({
propsData: {
@@ -390,7 +426,7 @@ describe('Environment table', () => {
production.name,
]);
- expect(wrapper.vm.sortedEnvironments[0].children).toEqual([master, addcibuildstatus]);
+ expect(wrapper.vm.sortedEnvironments[0].children).toEqual([main, addcibuildstatus]);
});
});
});