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 { ...@@ -56,7 +56,7 @@ export default class EnvironmentsStore {
if (filtered.size > 1) { if (filtered.size > 1) {
filtered = Object.assign(filtered, env, { isFolder: true, folderName: env.name }); filtered = Object.assign(filtered, env, { isFolder: true, folderName: env.name });
} else if (filtered.size === 1 && filtered.rollout_status_path) { } else if (filtered.size === 1 && filtered.rollout_status_path) {
filtered = Object.assign(filtered, env, { filtered = Object.assign({}, env, filtered, {
hasDeployBoard: true, hasDeployBoard: true,
isDeployBoardVisible: false, isDeployBoardVisible: false,
deployBoardData: {}, deployBoardData: {},
......
...@@ -184,6 +184,7 @@ ...@@ -184,6 +184,7 @@
.deploy-board-instances { .deploy-board-instances {
order: 2; order: 2;
margin-left: 20px; margin-left: 20px;
width: 100%;
.text { .text {
color: $gl-text-color-secondary; color: $gl-text-color-secondary;
......
...@@ -63,6 +63,16 @@ import { serverData, deployBoardMockData } from './mock_data'; ...@@ -63,6 +63,16 @@ import { serverData, deployBoardMockData } from './mock_data';
expect(store.state.environments[0].last_deployment).toEqual({}); expect(store.state.environments[0].last_deployment).toEqual({});
expect(store.state.environments[0].isStoppable).toEqual(true); 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', () => { it('should store available count', () => {
......
...@@ -66,6 +66,23 @@ export const serverData = [ ...@@ -66,6 +66,23 @@ export const serverData = [
updated_at: '2017-02-01T19:42:18.400Z', 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 = { 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