-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtaxonomy.spec.ts
More file actions
33 lines (27 loc) · 1.03 KB
/
taxonomy.spec.ts
File metadata and controls
33 lines (27 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* eslint-disable no-console */
/* eslint-disable promise/always-return */
import { stackInstance } from '../utils/stack-instance';
import { TTaxonomies, TTaxonomy } from './types';
import dotenv from 'dotenv';
import { TaxonomyQuery } from '../../src/lib/taxonomy-query';
import { Taxonomy } from '../../src/lib/taxonomy';
dotenv.config()
const stack = stackInstance();
describe('ContentType API test cases', () => {
it('should give taxonomies when taxonomies method is called', async () => {
const result = await makeTaxonomies().find<TTaxonomies>();
expect(result).toBeDefined();
});
it('should give a single taxonomy when taxonomy method is called with taxonomyUid', async () => {
const result = await makeTaxonomy('taxonomy_testing').fetch<TTaxonomy>();
expect(result).toBeDefined();
});
});
function makeTaxonomies(): TaxonomyQuery {
const taxonomies = stack.taxonomy();
return taxonomies;
}
function makeTaxonomy(taxonomyUid: string): Taxonomy {
const taxonomy = stack.taxonomy(taxonomyUid);
return taxonomy;
}