14 أسطر
432 B
TypeScript
14 أسطر
432 B
TypeScript
import { SortOrder } from '../enums/sort-order.enum';
|
|
import { resolveMongoSortDirection } from './sort.util';
|
|
|
|
describe('sort util', () => {
|
|
it('returns ascending for asc', () => {
|
|
expect(resolveMongoSortDirection(SortOrder.ASC)).toBe(1);
|
|
});
|
|
|
|
it('returns descending by default', () => {
|
|
expect(resolveMongoSortDirection(undefined)).toBe(-1);
|
|
expect(resolveMongoSortDirection(SortOrder.DESC)).toBe(-1);
|
|
});
|
|
});
|