Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(Bonus Pagamenti Digitali): [#176842973] Add tests for the CoBadge components #2826

Merged
merged 13 commits into from
Mar 1, 2021

Conversation

debiff
Copy link
Contributor

@debiff debiff commented Feb 15, 2021

Short description

This PR add the tests missed during the development of the cobadge flow.

List of changes proposed in this pull request

  • Added InternationalCircuitIconsBar component tests
  • Added BancomatInformation component tests
  • Added CoBadgeChooseType component tests
  • Added new test for BaseCoBadgeCard component

@pagopa-github-bot pagopa-github-bot changed the title [#176842973] Add tests for the CoBadge components chore(Bonus Pagamenti Digitali): [#176842973] Add tests for the CoBadge components Feb 15, 2021
@pagopa-github-bot
Copy link
Collaborator

pagopa-github-bot commented Feb 15, 2021

Affected stories

  • ⚙️ #176842973: Vogliamo avere dei test per i componenti co-badge che non hanno i test

Generated by 🚫 dangerJS against 379f267

@codecov
Copy link

codecov bot commented Feb 15, 2021

Codecov Report

Merging #2826 (7ddcf0e) into master (8b59304) will increase coverage by 0.09%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2826      +/-   ##
==========================================
+ Coverage   57.21%   57.30%   +0.09%     
==========================================
  Files         827      827              
  Lines       22997    22997              
  Branches     4308     4308              
==========================================
+ Hits        13157    13179      +22     
+ Misses       9752     9730      -22     
  Partials       88       88              
Impacted Files Coverage Δ
...components/wallet/InternationalCircuitIconsBar.tsx 100.00% <ø> (ø)
...t/onboarding/cobadge/screens/CoBadgeChooseType.tsx 97.77% <ø> (+37.77%) ⬆️
...res/wallet/bancomat/screen/BancomatInformation.tsx 100.00% <100.00%> (+19.04%) ⬆️
.../bancomat/utils/bancomatInformationBottomSheet.tsx 66.66% <100.00%> (ø)
...tures/wallet/cobadge/component/BaseCoBadgeCard.tsx 100.00% <100.00%> (+3.33%) ⬆️
...oarding/common/searchBank/SearchStartComponent.tsx 83.87% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8b59304...379f267. Read the comment docs.

Comment on lines 70 to 89
const ToBeTested: React.FunctionComponent<React.ComponentProps<
typeof CoBadgeChooseType
>> = (props: React.ComponentProps<typeof CoBadgeChooseType>) => (
<CoBadgeChooseType {...props} />
);
const mockStore = configureMockStore<GlobalState>();
const store: ReturnType<typeof mockStore> = mockStore({
...globalState
} as GlobalState);

return {
component: renderScreenFakeNavRedux<GlobalState, NavigationParams>(
ToBeTested,
ROUTES.WALLET_BPAY_DETAIL,
{ abi, legacyAddCreditCardBack },
store
),
store
};
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const ToBeTested: React.FunctionComponent<React.ComponentProps<
typeof CoBadgeChooseType
>> = (props: React.ComponentProps<typeof CoBadgeChooseType>) => (
<CoBadgeChooseType {...props} />
);
const mockStore = configureMockStore<GlobalState>();
const store: ReturnType<typeof mockStore> = mockStore({
...globalState
} as GlobalState);
return {
component: renderScreenFakeNavRedux<GlobalState, NavigationParams>(
ToBeTested,
ROUTES.WALLET_BPAY_DETAIL,
{ abi, legacyAddCreditCardBack },
store
),
store
};
};
const mockStore = configureMockStore<GlobalState>();
const store: ReturnType<typeof mockStore> = mockStore({
...globalState
} as GlobalState);
return {
component: renderScreenFakeNavRedux<GlobalState, NavigationParams>(
CoBadgeChooseType,
ROUTES.WALLET_BPAY_DETAIL,
{ abi, legacyAddCreditCardBack },
store
),
store
};
};

What you think about avoid to wrap the component? Or there is some reason behind?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. There is no reason to wrap the component.
I initially wrapped it because I had some problems with the nav props, and this seemed to fix it.
Removed in 379f267

@fabriziofff fabriziofff merged commit 0860f77 into master Mar 1, 2021
@fabriziofff fabriziofff deleted the 176842973-test-cobadge-component branch January 21, 2022 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants