mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-11 10:03:51 +00:00
Improved SearchBar test
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { evolveStringifiedQuery, parseQuery, stringifyQuery } from '../../../src/utils/helpers/query';
|
||||
import { parseQuery, stringifyQuery } from '../../../src/utils/helpers/query';
|
||||
|
||||
describe('query', () => {
|
||||
describe('parseQuery', () => {
|
||||
@@ -22,15 +22,4 @@ describe('query', () => {
|
||||
expect(stringifyQuery(queryObj)).toEqual(expectedResult);
|
||||
});
|
||||
});
|
||||
|
||||
describe('evolveStringifiedQuery', () => {
|
||||
it.each([
|
||||
[ '?foo=bar', { baz: 123 }, 'foo=bar&baz=123' ],
|
||||
[ 'foo=bar', { baz: 123 }, 'foo=bar&baz=123' ],
|
||||
[ 'foo=bar&baz=hello', { baz: 'world' }, 'foo=bar&baz=world' ],
|
||||
[ '?', { foo: 'some', bar: 'thing' }, 'foo=some&bar=thing' ],
|
||||
])('adds and overwrites params on provided query string', (query, extra, expected) => {
|
||||
expect(evolveStringifiedQuery(query, extra)).toEqual(expected);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user