Skip to content

Commit

Permalink
PID-1265 - Uncomment filter and fix tests expecting a filter count
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin LeBlanc committed Dec 15, 2023
1 parent e235c5e commit c5e9c71
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions lib/iden3comm/data/mappers/proof_request_filters_mapper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ class ProofRequestFiltersMapper
List<FilterEntity> filters = [
FilterEntity(
name: 'credential.credentialSubject.type', value: query.type!),
/*FilterEntity(
FilterEntity(
operator: FilterOperator.equalsAnyInList,
name: 'credential.@context',
value: query.context!),*/
value: query.context!),
];
if (query.allowedIssuers != null &&
query.allowedIssuers is List &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,39 +202,39 @@ main() {
test("From ProofRequestEntity to List<FilterEntity> LT operator", () {
List<FilterEntity> filters =
proofRequestFiltersMapper.mapFrom(mockProofRequestEntityLT);
expect(filters.length, 3);
expect(filters.length, 4);
expect(filters[0].name, "credential.credentialSubject.type");
expect(filters[0].value, "KYCAgeCredential");
});

test("From ProofRequestEntity to List<FilterEntity> GT operator", () {
List<FilterEntity> filters =
proofRequestFiltersMapper.mapFrom(mockProofRequestEntityGT);
expect(filters.length, 3);
expect(filters.length, 4);
expect(filters[0].name, "credential.credentialSubject.type");
expect(filters[0].value, "KYCAgeCredential");
});

test("From ProofRequestEntity to List<FilterEntity> EQ", () {
List<FilterEntity> filters =
proofRequestFiltersMapper.mapFrom(mockProofRequestEntityEQ);
expect(filters.length, 3);
expect(filters.length, 4);
expect(filters[0].name, "credential.credentialSubject.type");
expect(filters[0].value, "KYCAgeCredential");
});

test("From ProofRequestEntity to List<FilterEntity> IN", () {
List<FilterEntity> filters =
proofRequestFiltersMapper.mapFrom(mockProofRequestEntityIN);
expect(filters.length, 3);
expect(filters.length, 4);
expect(filters[0].name, "credential.credentialSubject.type");
expect(filters[0].value, "KYCAgeCredential");
});

test("From ProofRequestEntity to List<FilterEntity> NIN", () {
List<FilterEntity> filters =
proofRequestFiltersMapper.mapFrom(mockProofRequestEntityNIN);
expect(filters.length, 4);
expect(filters.length, 5);
expect(filters[0].name, "credential.credentialSubject.type");
expect(filters[0].value, "KYCAgeCredential");
});
Expand All @@ -244,7 +244,7 @@ main() {
() {
List<FilterEntity> filters =
proofRequestFiltersMapper.mapFrom(mockProofRequestEntityNINCountry);
expect(filters.length, 6);
expect(filters.length, 7);
expect(filters[0].name, "credential.credentialSubject.type");
expect(filters[0].value, "KYCCountryOfResidenceCredential");
});
Expand All @@ -253,7 +253,7 @@ main() {
() {
List<FilterEntity> filters = proofRequestFiltersMapper
.mapFrom(mockProofRequestEntityNotSupportedOperator);
expect(filters.length, 2);
expect(filters.length, 3);
expect(filters[0].name, "credential.credentialSubject.type");
expect(filters[0].value, "KYCCountryOfResidenceCredential");
});
Expand Down

0 comments on commit c5e9c71

Please sign in to comment.