mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.2 KiB
56 lines
1.2 KiB
/*
|
|
* Squidex Headless CMS
|
|
*
|
|
* @license
|
|
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved.
|
|
*/
|
|
|
|
import { Query } from '@app/shared/internal';
|
|
import { equalsQuery } from './query';
|
|
|
|
describe('equalsQuery', () => {
|
|
it('should return true when comparing with empty query', () => {
|
|
const lhs: Query = {};
|
|
|
|
const rhs: Query = {
|
|
filter: {
|
|
and: []
|
|
},
|
|
sort: []
|
|
};
|
|
|
|
expect(equalsQuery(lhs, rhs)).toBeTruthy();
|
|
});
|
|
|
|
it('should return true when comparing without sort', () => {
|
|
const lhs: Query = {
|
|
filter: {
|
|
and: []
|
|
}
|
|
};
|
|
|
|
const rhs: Query = {
|
|
filter: {
|
|
and: []
|
|
},
|
|
sort: []
|
|
};
|
|
|
|
expect(equalsQuery(lhs, rhs)).toBeTruthy();
|
|
});
|
|
|
|
it('should return true when comparing without filter', () => {
|
|
const lhs: Query = {
|
|
sort: []
|
|
};
|
|
|
|
const rhs: Query = {
|
|
filter: {
|
|
and: []
|
|
},
|
|
sort: []
|
|
};
|
|
|
|
expect(equalsQuery(lhs, rhs)).toBeTruthy();
|
|
});
|
|
});
|