Skip to content

Commit

Permalink
feat: #1325 Update tests for submit-app selector
Browse files Browse the repository at this point in the history
  • Loading branch information
nphivu414 committed May 27, 2020
1 parent 9162825 commit 18bf057
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions packages/marketplace/src/selector/__tests__/submit-app.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { ReduxState } from '@/types/core'
import { selectSubmitAppRevisionState, selectSubmitAppState } from '../submit-app'
import appState from '@/reducers/__stubs__/app-state'

const mockState: ReduxState = {
...appState,
submitRevision: {
formState: 'PENDING',
},
submitApp: {
formState: 'PENDING',
loading: false,
submitAppData: {
scopes: [
{
description: 'test',
name: 'test',
},
],
},
},
}

describe('selectSubmitAppRevisionState', () => {
it('should run correctly', () => {
const result = selectSubmitAppRevisionState(mockState)
expect(result).toEqual({
formState: 'PENDING',
})
})
})

describe('selectSubmitAppState', () => {
it('should run correctly', () => {
const result = selectSubmitAppState(mockState)
expect(result).toEqual({
formState: 'PENDING',
loading: false,
submitAppData: {
scopes: [
{
description: 'test',
name: 'test',
},
],
},
})
})
})

0 comments on commit 18bf057

Please sign in to comment.