-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [CLD-27]: Install App * Revert app-detail sagas: Remove clientId from select, Remove dev utility npm script * Fix Code Review Comments * Fix Code Review Comments * Feature UI: Fix Review * feature/cld-83-implement-client-uninstall-app
- Loading branch information
Showing
20 changed files
with
426 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { | ||
appUninstallRequestSuccess, | ||
appUninstallRequestDataFailure, | ||
appUninstallRequestData, | ||
appUninstallLoading, | ||
appUninstallDone | ||
} from '../app-uninstall' | ||
import ActionTypes from '@/constants/action-types' | ||
|
||
describe('app install actions', () => { | ||
it('should create a appUninstallRequestData action', () => { | ||
expect(appUninstallDone.type).toEqual(ActionTypes.APP_UNINSTALL_DONE) | ||
}) | ||
it('should create a appUninstallRequestData action', () => { | ||
expect(appUninstallRequestData.type).toEqual(ActionTypes.APP_UNINSTALL_REQUEST_DATA) | ||
}) | ||
|
||
it('should create a appUninstallRequestData action', () => { | ||
expect(appUninstallRequestSuccess.type).toEqual(ActionTypes.APP_UNINSTALL_REQUEST_DATA_SUCCESS) | ||
}) | ||
it('should create a appUninstallRequestDataFailure action', () => { | ||
expect(appUninstallRequestDataFailure.type).toEqual(ActionTypes.APP_UNINSTALL_REQUEST_DATA_FAILURE) | ||
}) | ||
|
||
it('should create a appUninstallLoading action', () => { | ||
expect(appUninstallLoading.type).toEqual(ActionTypes.APP_UNINSTALL_LOADING) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { actionCreator } from '../utils/actions' | ||
import ActionTypes from '../constants/action-types' | ||
|
||
export const appUninstallRequestData = actionCreator<void>(ActionTypes.APP_UNINSTALL_REQUEST_DATA) | ||
export const appUninstallLoading = actionCreator<void>(ActionTypes.APP_UNINSTALL_LOADING) | ||
export const appUninstallRequestDataFailure = actionCreator<void>(ActionTypes.APP_UNINSTALL_REQUEST_DATA_FAILURE) | ||
export const appUninstallRequestSuccess = actionCreator<void>(ActionTypes.APP_UNINSTALL_REQUEST_DATA_SUCCESS) | ||
export const appUninstallDone = actionCreator<void>(ActionTypes.APP_UNINSTALL_DONE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import appUninstallReducer, { defaultState, AppUninstallState } from '../app-uninstall' | ||
import { ActionType } from '../../types/core' | ||
import ActionTypes from '../../constants/action-types' | ||
|
||
const testData: Record<string, AppUninstallState> = { | ||
loading: { formState: 'SUBMITTING' } | ||
} | ||
|
||
describe('app-uninstall reducer', () => { | ||
it('should return fomState = PENDING if action not matched', () => { | ||
const newState = appUninstallReducer(undefined, { type: 'UNKNOWN' as ActionType, data: undefined }) | ||
expect(newState).toEqual(defaultState) | ||
}) | ||
|
||
it('should return formState = "SUBMITTING" when APP_UNINSTALL_LOADING action is called', () => { | ||
const newState = appUninstallReducer(defaultState, { | ||
type: ActionTypes.APP_UNINSTALL_LOADING as ActionType, | ||
data: true | ||
}) | ||
expect(newState).toEqual(testData.loading) | ||
}) | ||
|
||
it('should set formState = "SUCCESS" data when APP_UNINSTALL_REQUEST_DATA_SUCCESS action is called', () => { | ||
const newState = appUninstallReducer( | ||
{ formState: 'SUCCESS' }, | ||
{ | ||
type: ActionTypes.APP_UNINSTALL_REQUEST_DATA_SUCCESS as ActionType, | ||
data: undefined | ||
} | ||
) | ||
const expected = { | ||
...defaultState, | ||
formState: 'SUCCESS' | ||
} | ||
expect(newState).toEqual(expected) | ||
}) | ||
|
||
it('should set formState="ERROR" when ', () => { | ||
const newState = appUninstallReducer(testData.loading, { | ||
type: ActionTypes.APP_UNINSTALL_REQUEST_DATA_FAILURE as ActionType, | ||
data: undefined | ||
}) | ||
const expected = { | ||
...defaultState, | ||
formState: 'ERROR' | ||
} | ||
|
||
expect(newState).toEqual(expected) | ||
}) | ||
}) |
Oops, something went wrong.