-
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.
feat(IT Wallet): [SIW-1638] Handle unknown credential status (#6576)
## Short description This PR handles unexpected failures of the status attestation call. When that happens (for instance because of network problems), it is not possibile to determine the status of a credential. This "unknown" status is reflected in the UI and the credential detail cannot be accessed. ## List of changes proposed in this pull request - Added new card assets for the "Not available" status - Explicitly return `unknown` in `getCredentialStatus` (previously an unknown status attestation would return `valid`) - Modified `ItwCredentialCard` to display the greyed-out card - Added the new status in the cards DS section ## How to test The easiest way to test this PR is by mocking the result of the `/status` endpoint so that it returns 500. <img src="https://github.com/user-attachments/assets/daa56de4-04f1-493a-afdb-cba22064d3b2" width="240" /> <img src="https://github.com/user-attachments/assets/7a4af4ff-7bbb-4c70-b07a-6767c82eba56" width="240" /> --------- Co-authored-by: Federico Mastrini <[email protected]>
- Loading branch information
Showing
25 changed files
with
982 additions
and
45 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
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
37 changes: 26 additions & 11 deletions
37
ts/features/itwallet/common/components/__tests__/ItwDigitalVersionBadge.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 |
---|---|---|
@@ -1,17 +1,32 @@ | ||
import { render } from "@testing-library/react-native"; | ||
import React from "react"; | ||
import { ItwDigitalVersionBadge } from "../ItwDigitalVersionBadge"; | ||
import { | ||
ItwDigitalVersionBadge, | ||
TagColorScheme | ||
} from "../ItwDigitalVersionBadge"; | ||
|
||
describe("ItwDigitalVersionBadge", () => { | ||
it.each([ | ||
"MDL", | ||
"EuropeanDisabilityCard", | ||
"EuropeanHealthInsuranceCard", | ||
"InvalidCredentialType" | ||
])("should render correctly %s", credentialType => { | ||
const component = render( | ||
<ItwDigitalVersionBadge credentialType={credentialType} /> | ||
).toJSON(); | ||
expect(component).toMatchSnapshot(); | ||
}); | ||
["MDL", "default"], | ||
["MDL", "faded"], | ||
["MDL", "greyscale"], | ||
["EuropeanDisabilityCard", "default"], | ||
["EuropeanDisabilityCard", "faded"], | ||
["EuropeanDisabilityCard", "greyscale"], | ||
["EuropeanHealthInsuranceCard", "default"], | ||
["EuropeanHealthInsuranceCard", "faded"], | ||
["EuropeanHealthInsuranceCard", "greyscale"], | ||
["InvalidCredentialType", "default"] | ||
])( | ||
"should render correctly %s in state %s", | ||
(credentialType, colorScheme) => { | ||
const component = render( | ||
<ItwDigitalVersionBadge | ||
credentialType={credentialType} | ||
colorScheme={colorScheme as TagColorScheme} | ||
/> | ||
).toJSON(); | ||
expect(component).toMatchSnapshot(); | ||
} | ||
); | ||
}); |
Oops, something went wrong.