-
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.
Browse files
Browse the repository at this point in the history
* feat: #1125: Create app details standalone page
- Loading branch information
Showing
87 changed files
with
5,445 additions
and
260 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
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 |
---|---|---|
@@ -1,28 +1,32 @@ | ||
import { clientLoading, clientReceiveData, clientRequestData, clientClearData } from '../client' | ||
import { | ||
clientFetchAppSummary, | ||
clientFetchAppSummarySuccess, | ||
clientFetchAppSummaryFailed, | ||
clientClearAppSummary, | ||
} from '../client' | ||
import ActionTypes from '../../constants/action-types' | ||
import { appsDataStub, featuredAppsDataStub } from '../../sagas/__stubs__/apps' | ||
|
||
describe('client actions', () => { | ||
it('should create a clientLoading action', () => { | ||
expect(clientLoading.type).toEqual(ActionTypes.CLIENT_LOADING) | ||
expect(clientLoading(true).data).toEqual(true) | ||
it('should create a clientFetchAppSummary action', () => { | ||
expect(clientFetchAppSummary.type).toEqual(ActionTypes.CLIENT_FETCH_APP_SUMMARY) | ||
expect(clientFetchAppSummary({ page: 1 }).data).toEqual({ page: 1 }) | ||
}) | ||
|
||
it('should create a clientReceiveData action', () => { | ||
expect(clientReceiveData.type).toEqual(ActionTypes.CLIENT_RECEIVE_DATA) | ||
expect(clientReceiveData({ featuredApps: featuredAppsDataStub.data.data, apps: appsDataStub.data }).data).toEqual({ | ||
it('should create a clientFetchAppSummarySuccess action', () => { | ||
expect(clientFetchAppSummarySuccess.type).toEqual(ActionTypes.CLIENT_FETCH_APP_SUMMARY_SUCCESS) | ||
expect( | ||
clientFetchAppSummarySuccess({ featuredApps: featuredAppsDataStub.data.data, apps: appsDataStub.data }).data, | ||
).toEqual({ | ||
featuredApps: featuredAppsDataStub.data.data, | ||
apps: appsDataStub.data, | ||
}) | ||
}) | ||
|
||
it('should create a clientRequestData action', () => { | ||
expect(clientRequestData.type).toEqual(ActionTypes.CLIENT_REQUEST_DATA) | ||
expect(clientRequestData({ page: 1 }).data).toEqual({ page: 1 }) | ||
it('should create a clientFetchAppSummaryFailed action', () => { | ||
expect(clientFetchAppSummaryFailed.type).toEqual(ActionTypes.CLIENT_FETCH_APP_SUMMARY_FAILED) | ||
expect(clientFetchAppSummaryFailed('error').data).toEqual('error') | ||
}) | ||
|
||
it('should create a clientClearData action', () => { | ||
expect(clientClearData.type).toEqual(ActionTypes.CLIENT_CLEAR_DATA) | ||
expect(clientClearData(null).data).toEqual(null) | ||
expect(clientClearAppSummary.type).toEqual(ActionTypes.CLIENT_CLEAR_APP_SUMMARY) | ||
expect(clientClearAppSummary(null).data).toEqual(null) | ||
}) | ||
}) |
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 |
---|---|---|
@@ -1,9 +1,17 @@ | ||
import { actionCreator } from '../utils/actions' | ||
import ActionTypes from '../constants/action-types' | ||
import { ClientItem, ClientParams } from '../reducers/client' | ||
import { actionCreator } from '@/utils/actions' | ||
import ActionTypes from '@/constants/action-types' | ||
import { ClientAppSummary, ClientAppSummaryParams } from '@/reducers/client/app-summary' | ||
import { AppDetailData } from '@/reducers/client/app-detail' | ||
import { FetchAppDetailParams } from '@/services/apps' | ||
|
||
export const clientRequestData = actionCreator<ClientParams>(ActionTypes.CLIENT_REQUEST_DATA) | ||
export const clientRequestDataFailure = actionCreator<void>(ActionTypes.CLIENT_REQUEST_FAILURE) | ||
export const clientLoading = actionCreator<boolean>(ActionTypes.CLIENT_LOADING) | ||
export const clientReceiveData = actionCreator<ClientItem | undefined>(ActionTypes.CLIENT_RECEIVE_DATA) | ||
export const clientClearData = actionCreator<null>(ActionTypes.CLIENT_CLEAR_DATA) | ||
export const clientFetchAppSummary = actionCreator<ClientAppSummaryParams>(ActionTypes.CLIENT_FETCH_APP_SUMMARY) | ||
export const clientFetchAppSummarySuccess = actionCreator<ClientAppSummary | undefined>( | ||
ActionTypes.CLIENT_FETCH_APP_SUMMARY_SUCCESS, | ||
) | ||
export const clientFetchAppSummaryFailed = actionCreator<string>(ActionTypes.CLIENT_FETCH_APP_SUMMARY_FAILED) | ||
export const clientClearAppSummary = actionCreator<null>(ActionTypes.CLIENT_CLEAR_APP_SUMMARY) | ||
|
||
// Client App Detail | ||
export const clientFetchAppDetail = actionCreator<FetchAppDetailParams>(ActionTypes.CLIENT_FETCH_APP_DETAIL) | ||
export const clientFetchAppDetailSuccess = actionCreator<AppDetailData>(ActionTypes.CLIENT_FETCH_APP_DETAIL_SUCCESS) | ||
export const clientFetchAppDetailFailed = actionCreator<string>(ActionTypes.CLIENT_FETCH_APP_DETAIL_FAILED) |
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
Oops, something went wrong.