-
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.
feat: #1125: Update tests for components using react-redux hooks
- Loading branch information
Showing
31 changed files
with
4,406 additions
and
448 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 |
---|---|---|
@@ -1,32 +1,32 @@ | ||
import { | ||
clientAppSummaryRequestData, | ||
clientAppSummaryReceiveData, | ||
clientAppSummaryRequestDataFailure, | ||
clientAppSummaryClearData, | ||
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 clientAppSummaryRequestData action', () => { | ||
expect(clientAppSummaryRequestData.type).toEqual(ActionTypes.CLIENT_APP_SUMMARY_REQUEST_DATA) | ||
expect(clientAppSummaryRequestData({ page: 1 }).data).toEqual({ page: 1 }) | ||
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 clientAppSummaryReceiveData action', () => { | ||
expect(clientAppSummaryReceiveData.type).toEqual(ActionTypes.CLIENT_APP_SUMMARY_RECEIVE_DATA) | ||
it('should create a clientFetchAppSummarySuccess action', () => { | ||
expect(clientFetchAppSummarySuccess.type).toEqual(ActionTypes.CLIENT_FETCH_APP_SUMMARY_SUCCESS) | ||
expect( | ||
clientAppSummaryReceiveData({ featuredApps: featuredAppsDataStub.data.data, apps: appsDataStub.data }).data, | ||
clientFetchAppSummarySuccess({ featuredApps: featuredAppsDataStub.data.data, apps: appsDataStub.data }).data, | ||
).toEqual({ | ||
featuredApps: featuredAppsDataStub.data.data, | ||
apps: appsDataStub.data, | ||
}) | ||
}) | ||
it('should create a clientAppSummaryRequestDataFailure action', () => { | ||
expect(clientAppSummaryRequestDataFailure.type).toEqual(ActionTypes.CLIENT_APP_SUMMARY_REQUEST_FAILURE) | ||
expect(clientAppSummaryRequestDataFailure('error').data).toEqual('error') | ||
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(clientAppSummaryClearData.type).toEqual(ActionTypes.CLIENT_APP_SUMMARY_CLEAR_DATA) | ||
expect(clientAppSummaryClearData(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
Oops, something went wrong.