Skip to content

Commit

Permalink
chore(jumpstart): add claim to the names of claim-related actions a…
Browse files Browse the repository at this point in the history
…nd selectors (#5112)

### Description

As the title

### Test plan

CI

### Related issues

- Related to RET-1004

### Backwards compatibility

Y

### Network scalability

NA
  • Loading branch information
bakoushin committed Mar 16, 2024
1 parent e05faa1 commit eb588aa
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/jumpstart/selectors.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { showJumstartError, showJumstartLoading } from 'src/jumpstart/selectors'
import { showJumstartClaimError, showJumstartClaimLoading } from 'src/jumpstart/selectors'

describe('jumpstart selectors', () => {
it('should return the correct value for showJumpstartLoading', () => {
Expand All @@ -7,7 +7,7 @@ describe('jumpstart selectors', () => {
claimStatus: 'loading',
},
}
expect(showJumstartLoading(state)).toEqual(true)
expect(showJumstartClaimLoading(state)).toEqual(true)
})

it('should return the correct value for showJumpstartError', () => {
Expand All @@ -16,6 +16,6 @@ describe('jumpstart selectors', () => {
claimStatus: 'error',
},
}
expect(showJumstartError(state)).toEqual(true)
expect(showJumstartClaimError(state)).toEqual(true)
})
})
4 changes: 2 additions & 2 deletions src/jumpstart/selectors.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { RootState } from 'src/redux/reducers'

export const showJumstartLoading = (state: RootState) => {
export const showJumstartClaimLoading = (state: RootState) => {
return state.jumpstart.claimStatus === 'loading'
}

export const showJumstartError = (state: RootState) => {
export const showJumstartClaimError = (state: RootState) => {
return state.jumpstart.claimStatus === 'error'
}

Expand Down
8 changes: 4 additions & 4 deletions src/jumpstart/slice.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import reducer, {
jumpstartClaimErrorDismissed,
jumpstartClaimFailed,
jumpstartClaimLoadingDismissed,
jumpstartClaimStarted,
jumpstartClaimSucceeded,
jumpstartErrorDismissed,
jumpstartLoadingDismissed,
} from 'src/jumpstart/slice'

describe('Wallet Jumpstart', () => {
Expand All @@ -26,13 +26,13 @@ describe('Wallet Jumpstart', () => {
})

it('should handle jumpstart loading dismiss', () => {
const updatedState = reducer(undefined, jumpstartLoadingDismissed())
const updatedState = reducer(undefined, jumpstartClaimLoadingDismissed())

expect(updatedState).toHaveProperty('claimStatus', 'idle')
})

it('should handle jumpstart error dismiss', () => {
const updatedState = reducer(undefined, jumpstartErrorDismissed())
const updatedState = reducer(undefined, jumpstartClaimErrorDismissed())

expect(updatedState).toHaveProperty('claimStatus', 'idle')
})
Expand Down
8 changes: 4 additions & 4 deletions src/jumpstart/slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ const slice = createSlice({
claimStatus: 'error',
}),

jumpstartLoadingDismissed: (state) => ({
jumpstartClaimLoadingDismissed: (state) => ({
...state,
claimStatus: 'idle',
}),

jumpstartErrorDismissed: (state) => ({
jumpstartClaimErrorDismissed: (state) => ({
...state,
claimStatus: 'idle',
}),
Expand Down Expand Up @@ -79,8 +79,8 @@ export const {
jumpstartClaimStarted,
jumpstartClaimSucceeded,
jumpstartClaimFailed,
jumpstartLoadingDismissed,
jumpstartErrorDismissed,
jumpstartClaimLoadingDismissed,
jumpstartClaimErrorDismissed,
depositTransactionFlowStarted,
depositTransactionStarted,
depositTransactionSucceeded,
Expand Down

0 comments on commit eb588aa

Please sign in to comment.