Commit 0c91003e authored by Enrique Alcantara's avatar Enrique Alcantara

FE: Add hasLegacyAppLabel property to envs store

parent fa22bd92
......@@ -108,6 +108,7 @@ export default {
:deploy-board-data="model.deployBoardData"
:is-loading="model.isLoadingDeployBoard"
:is-empty="model.isEmptyDeployBoard"
:has-legacy-app-label="model.hasLegacyAppLabel"
:logs-path="model.logs_path"
/>
</div>
......
......@@ -24,6 +24,7 @@ export const setDeployBoard = (oldEnvironmentState, environment) => {
environment.rollout_status.status === 'found' ? environment.rollout_status : {},
isLoadingDeployBoard: environment.rollout_status.status === 'loading',
isEmptyDeployBoard: environment.rollout_status.status === 'not_found',
hasLegacyAppLabel: environment.rollout_status.has_legacy_app_label,
});
}
return parsedEnvironment;
......
......@@ -60,6 +60,26 @@ describe('Store', () => {
expect(store.state.environments[0].deployBoardData).toEqual(deployBoardMockData);
});
it('should set hasLegacyAppLabel property', () => {
expect(store.state.environments[0].deployBoardData).toEqual(deployBoardMockData);
const environment = {
name: 'foo',
size: 1,
latest: {
id: 1,
},
rollout_status: {
...deployBoardMockData,
status: 'not_found',
has_legacy_app_label: true,
},
};
store.storeEnvironments([environment]);
expect(store.state.environments[0].hasLegacyAppLabel).toBe(true);
});
});
describe('canaryCallout', () => {
......
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