Commit c8ff0e77 authored by Filipa Lacerda's avatar Filipa Lacerda

Fix css for deploy boards with few instances.

Fix JS to match the correct name
Adds tests
parent 080311e7
......@@ -56,7 +56,7 @@ export default class EnvironmentsStore {
if (filtered.size > 1) {
filtered = Object.assign(filtered, env, { isFolder: true, folderName: env.name });
} else if (filtered.size === 1 && filtered.rollout_status_path) {
filtered = Object.assign(filtered, env, {
filtered = Object.assign({}, env, filtered, {
hasDeployBoard: true,
isDeployBoardVisible: false,
deployBoardData: {},
......
......@@ -184,6 +184,7 @@
.deploy-board-instances {
order: 2;
margin-left: 20px;
width: 100%;
.text {
color: $gl-text-color-secondary;
......
......@@ -63,6 +63,16 @@ import { serverData, deployBoardMockData } from './mock_data';
expect(store.state.environments[0].last_deployment).toEqual({});
expect(store.state.environments[0].isStoppable).toEqual(true);
});
it('should store latest.name when the environment is not a folder', () => {
store.storeEnvironments(serverData);
expect(store.state.environments[2].name).toEqual(serverData[2].latest.name);
});
it('should store root level name when environment is a folder', () => {
store.storeEnvironments(serverData);
expect(store.state.environments[1].name).toEqual(serverData[1].name);
});
});
it('should store available count', () => {
......
......@@ -66,6 +66,23 @@ export const serverData = [
updated_at: '2017-02-01T19:42:18.400Z',
},
},
{
name: 'build',
size: 1,
latest: {
id: 12,
name: 'build/update-README',
state: 'available',
external_url: null,
environment_type: 'build',
last_deployment: null,
'stop_action?': false,
environment_path: '/root/review-app/environments/12',
stop_path: '/root/review-app/environments/12/stop',
created_at: '2017-02-01T19:42:18.400Z',
updated_at: '2017-02-01T19:42:18.400Z',
},
},
];
export const environment = {
......
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