Commit bb3c3843 authored by Emily Ring's avatar Emily Ring

Updated file for jest testing

Moved environments_store_spec.js
from ee/spec/javascripts/ to ee/spec/frontend/
and updated mock_data variables
to move testing from karma to jest
parent e622d585
import Store from 'ee/environments/stores/environments_store'; import Store from 'ee/environments/stores/environments_store';
import { serverData, deployBoardMockData } from './mock_data'; import { serverDataList, deployBoardMockData } from './mock_data';
describe('Store', () => { describe('Store', () => {
let store; let store;
...@@ -84,13 +84,13 @@ describe('Store', () => { ...@@ -84,13 +84,13 @@ describe('Store', () => {
describe('canaryCallout', () => { describe('canaryCallout', () => {
it('should add banner underneath the second environment', () => { it('should add banner underneath the second environment', () => {
store.storeEnvironments(serverData); store.storeEnvironments(serverDataList);
expect(store.state.environments[1].showCanaryCallout).toEqual(true); expect(store.state.environments[1].showCanaryCallout).toEqual(true);
}); });
it('should add banner underneath first environment when only one environment', () => { 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); expect(store.state.environments[0].showCanaryCallout).toEqual(true);
}); });
......
...@@ -132,3 +132,18 @@ export const environmentsList = [ ...@@ -132,3 +132,18 @@ export const environmentsList = [
...sharedEnvironmentData(12), ...sharedEnvironmentData(12),
}, },
]; ];
export const serverDataList = [
{
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),
},
},
...environmentsList,
];
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