|
1 | | -import { QueryOperation, QueryOperator } from "../../src/lib/types"; |
2 | | -import {TaxonomyQuery} from "../../src/lib/taxonomy-query"; |
| 1 | +import { QueryOperation, QueryOperator, TaxonomyQueryOperation } from "../../src/lib/types"; |
3 | 2 | import { stackInstance } from "../utils/stack-instance"; |
4 | 3 | import dotenv from "dotenv" |
5 | | -import { TEntries, TEntry } from "./types"; |
| 4 | +import { TEntries } from "./types"; |
6 | 5 |
|
7 | 6 | dotenv.config(); |
8 | 7 | jest.setTimeout(60000); |
@@ -45,25 +44,25 @@ describe('Taxonomy API test cases', () => { |
45 | 44 | }) |
46 | 45 |
|
47 | 46 | test('Taxonomies Endpoint: Get Entries With Taxonomy Terms and Also Matching Its Children Term ($eq_below, level)', async () => { |
48 | | - let taxonomy = stack.Taxonomy().where('taxonomies.one', QueryOperation.EQ_BELOW, 'term_one', {"levels": 1}) |
| 47 | + let taxonomy = stack.Taxonomy().where('taxonomies.one', TaxonomyQueryOperation.EQ_BELOW, 'term_one', {"levels": 1}) |
49 | 48 | const data = await taxonomy.find<TEntries>(); |
50 | 49 | return expect(data.entries.length).toBeGreaterThan(0); |
51 | 50 | }) |
52 | 51 |
|
53 | 52 | test('Taxonomies Endpoint: Get Entries With Taxonomy Terms Children\'s and Excluding the term itself ($below, level)', async () => { |
54 | | - let taxonomy = stack.Taxonomy().where('taxonomies.one', QueryOperation.BELOW, 'term_one', {"levels": 1}) |
| 53 | + let taxonomy = stack.Taxonomy().where('taxonomies.one', TaxonomyQueryOperation.BELOW, 'term_one', {"levels": 1}) |
55 | 54 | const data = await taxonomy.find<TEntries>(); |
56 | 55 | return expect(data.entries.length).toBeGreaterThan(0); |
57 | 56 | }) |
58 | 57 |
|
59 | 58 | test('Taxonomies Endpoint: Get Entries With Taxonomy Terms and Also Matching Its Parent Term ($eq_above, level)', async () => { |
60 | | - let taxonomy = stack.Taxonomy().where('taxonomies.one', QueryOperation.EQ_ABOVE, 'term_one', {"levels": 1}) |
| 59 | + let taxonomy = stack.Taxonomy().where('taxonomies.one', TaxonomyQueryOperation.EQ_ABOVE, 'term_one', {"levels": 1}) |
61 | 60 | const data = await taxonomy.find<TEntries>(); |
62 | 61 | return expect(data.entries.length).toBeGreaterThan(0); |
63 | 62 | }) |
64 | 63 |
|
65 | 64 | test('Taxonomies Endpoint: Get Entries With Taxonomy Terms Parent and Excluding the term itself ($above, level)', async () => { |
66 | | - let taxonomy = stack.Taxonomy().where('taxonomies.one', QueryOperation.ABOVE, 'term_one_child', {"levels": 1}) |
| 65 | + let taxonomy = stack.Taxonomy().where('taxonomies.one', TaxonomyQueryOperation.ABOVE, 'term_one_child', {"levels": 1}) |
67 | 66 | const data = await taxonomy.find<TEntries>(); |
68 | 67 | return expect(data.entries.length).toBeGreaterThan(0); |
69 | 68 | }) |
|
0 commit comments