Skip to content

Commit

Permalink
feat: refactor to allow unlimited facets - WIP (#9332)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanegigandet authored Nov 20, 2023
1 parent 4b25b42 commit 77cf12e
Show file tree
Hide file tree
Showing 25 changed files with 1,491 additions and 973 deletions.
4 changes: 4 additions & 0 deletions lib/ProductOpener/APITest.pm
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ my $tests_ref = (
headers => {header1 => value1, } # optional. You may add an undef value to test for the inexistance of a header
response_content_must_match => "regexp" # optional. You may add a case insensitive regexp (e.g. "Product saved") that must be matched
response_content_must_not_match => "regexp" # optional. You may add a case insensitive regexp (e.g. "error") that must not be matched
sort_products_by => "product_name" # optional. You may provide a field to sort the returned products by so that they are in an expected order
}
],
);
Expand Down Expand Up @@ -565,6 +566,9 @@ sub execute_api_tests ($file, $tests_ref, $ua = undef) {
if (ref($decoded_json) eq 'HASH') {
if (defined $decoded_json->{'products'}) {
normalize_products_for_test_comparison($decoded_json->{'products'});
if (defined $test_ref->{sort_products_by}) {
sort_products_for_test_comparison($decoded_json->{'products'}, $test_ref->{sort_products_by});
}
}
if (defined $decoded_json->{'product'}) {
normalize_product_for_test_comparison($decoded_json->{'product'});
Expand Down
Loading

0 comments on commit 77cf12e

Please sign in to comment.