Skip to content

Commit

Permalink
refactore: Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bibash28 committed Dec 6, 2024
1 parent 1de18c1 commit 0b9c00b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
15 changes: 12 additions & 3 deletions packages/oidc4vc/test/src/oidc4vc_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -552,14 +552,21 @@ void main() {

test('When getCredentialType receive url it returns json response',
() async {
final configuration = OpenIdConfiguration.fromJson(
jsonDecode(openIdConfiguration) as Map<String, dynamic>,
);

final credentialEndpoint =
oidc4vc.readCredentialEndpoint(configuration);

final credentialResponseData = await oidc4vc.getSingleCredential(
openIdConfiguration: OpenIdConfiguration.fromJson(
jsonDecode(openIdConfiguration) as Map<String, dynamic>,
),
openIdConfiguration: configuration,
accessToken: accessToken,
nonce: nonce,
dio: client,
credentialData: {},
dPop: null,
credentialEndpoint: credentialEndpoint,
);

expect(credentialResponseData, expecedCredentialResponse);
Expand Down Expand Up @@ -819,6 +826,7 @@ void main() {
'eyJhbGciOiJFUzI1NiIsImtpZCI6ImRpZDp3ZWI6dGFsYW8uY28ja2V5LTIiLCJ0eXAiOiJ3YWxsZXQtYXR0ZXN0YXRpb24rand0In0.eyJhdXRob3JpemF0aW9uX2VuZHBvaW50IjoiaHR0cHM6Ly9hcHAuYWx0bWUuaW8vYXBwL2Rvd25sb2FkL2F1dGhvcml6ZSIsImNsaWVudF9pZF9zY2hlbWVzX3N1cHBvcnRlZCI6WyJkaWQiLCJyZWRpcmVjdF91cmkiLCJ4NTA5X3Nhbl9kbnMiLCJ2ZXJpZmllcl9hdHRlc3RhdGlvbiJdLCJjbmYiOnsiandrIjp7ImNydiI6IlAtMjU2Iiwia2lkIjoiOGI2cEhFa21JY1N2cG1oM0xQRU03ZGpIUXZMZUZZeEZrYVR4YjFEYmZaUSIsImt0eSI6IkVDIiwieCI6IkVQb194VkhFai1QYzB1eGJtY3hNajJMNjZQb0doLXVvWUdBemdHS012T1EiL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dmFsdWVzX3N1cHBvcnRlZCI6WyJFUzI1NiIsIkVTMjU2SyIsIkVkRFNBIl19LCJ2YytzZC1qd3QiOnsiYWxnX3ZhbHVlc19zdXBwb3J0ZWQiOlsiRVMyNTYiLCJFUzI1NksiLCJFZERTQSJdfX0sIndhbGxldF9uYW1lIjoidGFsYW9fd2FsbGV0In0.Gc6BTw1ppqvSuKtxbf-lhxhjb1HaaBvnWHk1J0ZMNah6D0Ucr1WzofXYPbJkksz3AwLrkAx5HyBdt4NP0anIUA',
oAuthClientAttestationPop:
'eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiI4YjZwSEVrbUljU3ZwbWgzTFBFTTdkakhRdkxlRll4RmthVHhiMURiZlpRIiwiYXVkIjoiaHR0cHM6Ly90YWxhby5jby9pc3N1ZXIvZ3Jsdnpja29meSIsIm5iZiI6MTcxODYzMDkwNCwiZXhwIjoxNzE4NjMwOTY0fQ.versm2Ejz9W5uVbejGiOl1ytAoAHSeo5zZLer-hhiWBm8y1QgCmFB5xay4xWi3Nlx2KC2f1wsZ6tMVsrfZD2rg',
dPop: null,
);
},
throwsA(isA<Exception>()),
Expand Down
3 changes: 2 additions & 1 deletion test/app/shared/widget/wallet_logo_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ void main() {

final Image image = tester.widget(imageFinder);
final AssetImage imageProvider = image.image as AssetImage;
expect(imageProvider.assetName, ImageStrings.diipLogo);
// expect(imageProvider.assetName, ImageStrings.diipLogo);
expect(imageProvider.assetName, ImageStrings.appLogo);
});

testWidgets(
Expand Down

0 comments on commit 0b9c00b

Please sign in to comment.