-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(IT Wallet): [SIW-1806] Fix state inconsistencies in wallet home s…
…creen (#6532)
- Loading branch information
Showing
26 changed files
with
2,304 additions
and
1,399 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
17 changes: 5 additions & 12 deletions
17
ts/features/itwallet/common/components/ItwWalletReadyBanner.tsx
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
88 changes: 4 additions & 84 deletions
88
ts/features/itwallet/common/components/discoveryBanner/__tests__/ItwDiscoveryBanner.test.tsx
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
41 changes: 41 additions & 0 deletions
41
...twallet/common/components/discoveryBanner/__tests__/ItwDiscoveryBannerStandalone.test.tsx
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,41 @@ | ||
import configureMockStore from "redux-mock-store"; | ||
import ROUTES from "../../../../../../navigation/routes"; | ||
import { applicationChangeState } from "../../../../../../store/actions/application"; | ||
import { appReducer } from "../../../../../../store/reducers"; | ||
import { GlobalState } from "../../../../../../store/reducers/types"; | ||
import { renderScreenWithNavigationStoreContext } from "../../../../../../utils/testWrapper"; | ||
import * as selectors from "../../../store/selectors"; | ||
import { ItwDiscoveryBannerStandalone } from "../ItwDiscoveryBannerStandalone"; | ||
|
||
describe("ItwDiscoveryBannerStandalone", () => { | ||
test.each([true, false] as ReadonlyArray<boolean>)( | ||
"should match snapshot when isItwDiscoveryBannerRenderable is %p", | ||
isItwDiscoveryBannerRenderable => { | ||
jest | ||
.spyOn(selectors, "isItwDiscoveryBannerRenderableSelector") | ||
.mockImplementation(() => isItwDiscoveryBannerRenderable); | ||
|
||
const { component } = renderComponent(); | ||
expect(component.toJSON()).toMatchSnapshot(); | ||
} | ||
); | ||
}); | ||
|
||
const renderComponent = () => { | ||
const globalState = appReducer(undefined, applicationChangeState("active")); | ||
|
||
const mockStore = configureMockStore<GlobalState>(); | ||
const store: ReturnType<typeof mockStore> = mockStore( | ||
globalState as GlobalState | ||
); | ||
|
||
return { | ||
component: renderScreenWithNavigationStoreContext<GlobalState>( | ||
ItwDiscoveryBannerStandalone, | ||
ROUTES.WALLET_HOME, | ||
{}, | ||
store | ||
), | ||
store | ||
}; | ||
}; |
Oops, something went wrong.