Commit e193b928 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch '194276-move-environments_store_spec-to-jest' into 'master'

Partially migrate ee/spec/javascripts/environments/ to Jest

See merge request gitlab-org/gitlab!24995
parents 09b7dd8f 574aed28
import Store from 'ee/environments/stores/environments_store';
import { serverData, deployBoardMockData } from './mock_data';
import { serverDataList, deployBoardMockData } from './mock_data';
describe('Store', () => {
let store;
......@@ -84,13 +84,13 @@ describe('Store', () => {
describe('canaryCallout', () => {
it('should add banner underneath the second environment', () => {
store.storeEnvironments(serverData);
store.storeEnvironments(serverDataList);
expect(store.state.environments[1].showCanaryCallout).toEqual(true);
});
it('should add banner underneath first environment when only one environment', () => {
store.storeEnvironments(serverData.slice(0, 1));
store.storeEnvironments(serverDataList.slice(0, 1));
expect(store.state.environments[0].showCanaryCallout).toEqual(true);
});
......
......@@ -132,3 +132,39 @@ export const environmentsList = [
...sharedEnvironmentData(12),
},
];
export const serverDataList = [
{
name: 'DEV',
size: 1,
latest: {
name: 'DEV',
environment_type: null,
created_at: '2017-01-31T10:53:46.894Z',
updated_at: '2017-01-31T10:53:46.894Z',
...sharedEnvironmentData(7),
},
},
{
name: 'build',
size: 5,
latest: {
name: 'build/update-README',
environment_type: 'build',
created_at: '2017-02-01T19:42:18.400Z',
updated_at: '2017-02-01T19:42:18.400Z',
...sharedEnvironmentData(12),
},
},
{
name: 'build',
size: 1,
latest: {
name: 'build/update-README',
environment_type: 'build',
created_at: '2017-02-01T19:42:18.400Z',
updated_at: '2017-02-01T19:42:18.400Z',
...sharedEnvironmentData(15),
},
},
];
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