Commit 565274aa authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'from-installable-to-not-installable' into 'master'

Handle dependencies between cluster managed apps installation status

See merge request gitlab-org/gitlab-ce!29999
parents 2428a550 71c53eec
...@@ -80,6 +80,9 @@ const applicationStateMachine = { ...@@ -80,6 +80,9 @@ const applicationStateMachine = {
installFailed: false, installFailed: false,
}, },
}, },
[NOT_INSTALLABLE]: {
target: NOT_INSTALLABLE,
},
// This is possible in artificial environments for E2E testing // This is possible in artificial environments for E2E testing
[INSTALLED]: { [INSTALLED]: {
target: INSTALLED, target: INSTALLED,
...@@ -108,6 +111,9 @@ const applicationStateMachine = { ...@@ -108,6 +111,9 @@ const applicationStateMachine = {
updateSuccessful: false, updateSuccessful: false,
}, },
}, },
[NOT_INSTALLABLE]: {
target: NOT_INSTALLABLE,
},
[UNINSTALL_EVENT]: { [UNINSTALL_EVENT]: {
target: UNINSTALLING, target: UNINSTALLING,
effects: { effects: {
......
...@@ -75,6 +75,7 @@ describe('applicationStateMachine', () => { ...@@ -75,6 +75,7 @@ describe('applicationStateMachine', () => {
expectedState | event | effects expectedState | event | effects
${INSTALLING} | ${INSTALL_EVENT} | ${{ installFailed: false }} ${INSTALLING} | ${INSTALL_EVENT} | ${{ installFailed: false }}
${INSTALLED} | ${INSTALLED} | ${NO_EFFECTS} ${INSTALLED} | ${INSTALLED} | ${NO_EFFECTS}
${NOT_INSTALLABLE} | ${NOT_INSTALLABLE} | ${NO_EFFECTS}
`(`transitions to $expectedState on $event event and applies $effects`, data => { `(`transitions to $expectedState on $event event and applies $effects`, data => {
const { expectedState, event, effects } = data; const { expectedState, event, effects } = data;
const currentAppState = { const currentAppState = {
...@@ -111,6 +112,7 @@ describe('applicationStateMachine', () => { ...@@ -111,6 +112,7 @@ describe('applicationStateMachine', () => {
expectedState | event | effects expectedState | event | effects
${UPDATING} | ${UPDATE_EVENT} | ${{ updateFailed: false, updateSuccessful: false }} ${UPDATING} | ${UPDATE_EVENT} | ${{ updateFailed: false, updateSuccessful: false }}
${UNINSTALLING} | ${UNINSTALL_EVENT} | ${{ uninstallFailed: false, uninstallSuccessful: false }} ${UNINSTALLING} | ${UNINSTALL_EVENT} | ${{ uninstallFailed: false, uninstallSuccessful: false }}
${NOT_INSTALLABLE} | ${NOT_INSTALLABLE} | ${NO_EFFECTS}
`(`transitions to $expectedState on $event event and applies $effects`, data => { `(`transitions to $expectedState on $event event and applies $effects`, data => {
const { expectedState, event, effects } = data; const { expectedState, event, effects } = data;
const currentAppState = { const currentAppState = {
...@@ -119,7 +121,7 @@ describe('applicationStateMachine', () => { ...@@ -119,7 +121,7 @@ describe('applicationStateMachine', () => {
expect(transitionApplicationState(currentAppState, event)).toEqual({ expect(transitionApplicationState(currentAppState, event)).toEqual({
status: expectedState, status: expectedState,
...effects, ...noEffectsToEmptyObject(effects),
}); });
}); });
}); });
......
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