Add Set Service test
This commit is contained in:
25
test/setService.test.ts
Normal file
25
test/setService.test.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import { findSetByID, findSetsByQueries, getAllSets } from '../src/services/setService';
|
||||
import { Query } from "../src/interfaces/query";
|
||||
import { Set } from "../src/interfaces/set";
|
||||
|
||||
describe('Set Service', () => {
|
||||
it('should get a single set using query parameters', async () => {
|
||||
const params: Query[] = [{
|
||||
name: 'name',
|
||||
value: 'Base'
|
||||
}];
|
||||
|
||||
const result: Set[] = await findSetsByQueries(params);
|
||||
expect(result[0].name).toEqual('Base');
|
||||
})
|
||||
|
||||
it('should get a single set using a set id', async () => {
|
||||
const result: Set = await findSetByID('base1');
|
||||
expect(result.name).toEqual('Base');
|
||||
})
|
||||
|
||||
it('should get a default list of sets using the sets resource with no query params', async () => {
|
||||
const results: Set[] = await getAllSets();
|
||||
expect(results.length).toBeLessThanOrEqual(250);
|
||||
});
|
||||
})
|
||||
Reference in New Issue
Block a user