Skip to content

Commit

Permalink
Fixed tests to reflect new logic
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaPolit committed Oct 18, 2024
1 parent f585b5e commit 5521ccc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
16 changes: 12 additions & 4 deletions app/api/suggestions/specs/customFilters.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ describe('suggestions with CustomFilters', () => {
{ sharedId: 'labeled-mismatch', language: 'es' },
{ sharedId: 'unlabeled-no-context', language: 'en' },
{ sharedId: 'unlabeled-no-context', language: 'es' },
{ sharedId: 'unlabeled-no-suggestion', language: 'en' },
{ sharedId: 'unlabeled-no-suggestion', language: 'es' },
{ sharedId: 'unlabeled-error', language: 'en' },
{ sharedId: 'unlabeled-error', language: 'es' },
{ sharedId: 'unlabeled-no-suggestion', language: 'en' },
{ sharedId: 'unlabeled-no-suggestion', language: 'es' },
]);
});

Expand Down Expand Up @@ -73,8 +73,12 @@ describe('suggestions with CustomFilters', () => {
description: 'filtering for nonLabeled',
customFilter: { ...blankCustomFilter, nonLabeled: true },
expectedSuggestions: [
{ sharedId: 'unlabeled-obsolete', language: 'en' },
{ sharedId: 'unlabeled-obsolete', language: 'es' },
{ sharedId: 'unlabeled-no-context', language: 'en' },
{ sharedId: 'unlabeled-no-context', language: 'es' },
{ sharedId: 'unlabeled-error', language: 'en' },
{ sharedId: 'unlabeled-error', language: 'es' },
{ sharedId: 'unlabeled-no-suggestion', language: 'en' },
{ sharedId: 'unlabeled-no-suggestion', language: 'es' },
],
Expand Down Expand Up @@ -131,10 +135,10 @@ describe('suggestions with CustomFilters', () => {
expectedSuggestions: [
{ sharedId: 'labeled-mismatch', language: 'en' },
{ sharedId: 'labeled-mismatch', language: 'es' },
{ sharedId: 'unlabeled-no-suggestion', language: 'en' },
{ sharedId: 'unlabeled-no-suggestion', language: 'es' },
{ sharedId: 'unlabeled-error', language: 'en' },
{ sharedId: 'unlabeled-error', language: 'es' },
{ sharedId: 'unlabeled-no-suggestion', language: 'en' },
{ sharedId: 'unlabeled-no-suggestion', language: 'es' },
],
},
{
Expand All @@ -154,12 +158,16 @@ describe('suggestions with CustomFilters', () => {
'filtering for OR combinations of complimentary filters like: labeled OR nonLabeled, which would result in all suggestions',
customFilter: { ...blankCustomFilter, labeled: true, nonLabeled: true },
expectedSuggestions: [
{ sharedId: 'unlabeled-obsolete', language: 'en' },
{ sharedId: 'unlabeled-obsolete', language: 'es' },
{ sharedId: 'labeled-match', language: 'en' },
{ sharedId: 'labeled-match', language: 'es' },
{ sharedId: 'labeled-mismatch', language: 'en' },
{ sharedId: 'labeled-mismatch', language: 'es' },
{ sharedId: 'unlabeled-no-context', language: 'en' },
{ sharedId: 'unlabeled-no-context', language: 'es' },
{ sharedId: 'unlabeled-error', language: 'en' },
{ sharedId: 'unlabeled-error', language: 'es' },
{ sharedId: 'unlabeled-no-suggestion', language: 'en' },
{ sharedId: 'unlabeled-no-suggestion', language: 'es' },
],
Expand Down
6 changes: 3 additions & 3 deletions app/api/suggestions/specs/routes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -419,10 +419,10 @@ describe('aggregation routes', () => {
expect(response.body).toEqual({
total: 14,
labeled: 4,
nonLabeled: 6,
match: 6,
nonLabeled: 10,
match: 4,
mismatch: 4,
obsolete: 2,
obsolete: 4,
error: 2,
});
});
Expand Down

0 comments on commit 5521ccc

Please sign in to comment.