-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CLD-435] developer uninstall client installed apps (#184)
* [CLD-435] developer uninstall client installed apps * [CLD-435] fix review and test * [CLD-435] add type component compose redux and withFormik * [CLD-435] fix test failed
- Loading branch information
Showing
51 changed files
with
1,800 additions
and
1,054 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,39 @@ | ||
import { | ||
appInstallationsReceiveData, | ||
appInstallationsRequestData, | ||
appInstallationsRequestDataFailure, | ||
appInstallationsRequestInstall, | ||
appInstallationsRequestUninstall, | ||
appInstallationsSetFormState | ||
} from '../app-installations' | ||
import ActionTypes from '@/constants/action-types' | ||
import { installationsStub } from '@/sagas/__stubs__/installations' | ||
|
||
describe('app install actions', () => { | ||
it('should create a appInstallationsReceiveData action', () => { | ||
expect(appInstallationsReceiveData.type).toEqual(ActionTypes.APP_INSTALLATIONS_RECEIVE_DATA) | ||
expect(appInstallationsReceiveData(installationsStub).data).toEqual(installationsStub) | ||
}) | ||
it('should create a appInstallationsRequestData action', () => { | ||
expect(appInstallationsRequestData.type).toEqual(ActionTypes.APP_INSTALLATIONS_REQUEST_DATA) | ||
expect(appInstallationsRequestData({ appId: ['1'] }).data).toEqual({ appId: ['1'] }) | ||
}) | ||
it('should create a appInstallationsRequestDataFailure action', () => { | ||
expect(appInstallationsRequestDataFailure.type).toEqual(ActionTypes.APP_INSTALLATIONS_REQUEST_DATA_FAILURE) | ||
}) | ||
it('should create a appInstallationsRequestInstall action', () => { | ||
expect(appInstallationsRequestInstall.type).toEqual(ActionTypes.APP_INSTALLATIONS_REQUEST_INSTALL) | ||
expect(appInstallationsRequestInstall({ appId: '1' }).data).toEqual({ appId: '1' }) | ||
}) | ||
it('should create a appInstallationsRequestUninstall action', () => { | ||
expect(appInstallationsRequestUninstall.type).toEqual(ActionTypes.APP_INSTALLATIONS_REQUEST_UNINSTALL) | ||
expect(appInstallationsRequestUninstall({ appId: '1', installationId: '1' }).data).toEqual({ | ||
appId: '1', | ||
installationId: '1' | ||
}) | ||
}) | ||
it('should create a appInstallationsSetFormState action', () => { | ||
expect(appInstallationsSetFormState.type).toEqual(ActionTypes.APP_INSTALLATIONS_SET_FORM_STATE) | ||
expect(appInstallationsSetFormState('PENDING').data).toEqual('PENDING') | ||
}) | ||
}) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,39 @@ | ||
import { actionCreator } from '../utils/actions' | ||
import ActionTypes from '../constants/action-types' | ||
import { FormState } from '../types/core' | ||
import { | ||
PagedResultInstallationModel_, | ||
TerminateInstallationModel, | ||
CreateInstallationModel | ||
} from '@/types/marketplace-api-schema' | ||
|
||
export interface InstallationParams { | ||
appId?: string[] | ||
developerId?: string[] | ||
clientId?: string[] | ||
externalAppId?: string[] | ||
showTerminated?: boolean | ||
pageSize?: number | ||
pageNumber?: number | ||
} | ||
|
||
export type InstallParams = CreateInstallationModel | ||
|
||
export type UninstallParams = { | ||
installationId: string | ||
} & TerminateInstallationModel | ||
|
||
export const appInstallationsRequestData = actionCreator<InstallationParams>(ActionTypes.APP_INSTALLATIONS_REQUEST_DATA) | ||
export const appInstallationsReceiveData = actionCreator<PagedResultInstallationModel_>( | ||
ActionTypes.APP_INSTALLATIONS_RECEIVE_DATA | ||
) | ||
export const appInstallationsRequestDataFailure = actionCreator<void>( | ||
ActionTypes.APP_INSTALLATIONS_REQUEST_DATA_FAILURE | ||
) | ||
export const appInstallationsRequestInstall = actionCreator<InstallParams>( | ||
ActionTypes.APP_INSTALLATIONS_REQUEST_INSTALL | ||
) | ||
export const appInstallationsRequestUninstall = actionCreator<UninstallParams>( | ||
ActionTypes.APP_INSTALLATIONS_REQUEST_UNINSTALL | ||
) | ||
export const appInstallationsSetFormState = actionCreator<FormState>(ActionTypes.APP_INSTALLATIONS_SET_FORM_STATE) |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.