Skip to content

Commit

Permalink
Add unit test
Browse files Browse the repository at this point in the history
Signed-off-by: Hailong Cui <ihailong@amazon.com>
  • Loading branch information
Hailong-am committed Oct 24, 2023
1 parent 0c43103 commit 711f536
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,25 @@ describe('#getQueryParams', () => {
);
});
});

describe('`flags` parameter', () => {
it('does not include flags when `flags` is not specified', () => {
const result = getQueryParams({
registry,
search,
});
expectResult(result, expect.not.objectContaining({ flags: expect.anything() }));
});

it('includes flags when specified', () => {
const result = getQueryParams({
registry,
search,
flags: 'abc',
});
expectResult(result, expect.objectContaining({ flags: expect.stringMatching('abc') }));
});
});
});

describe('when using prefix search (query.bool.should)', () => {
Expand Down

0 comments on commit 711f536

Please sign in to comment.