Skip to content

Commit 7ac5770

Browse files
authored
Merge pull request #382 from bakaphp/add-tags-test
test: add tags test
2 parents af069ae + 7be8e5f commit 7ac5770

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "0.27.4",
2+
"version": "0.27.5",
33
"license": "MIT",
44
"main": "dist/index.js",
55
"typings": "dist/index.d.ts",

src/modules/tags/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ import {
1515
} from 'types/tags';
1616

1717
export class Tags {
18-
constructor(protected client: ClientType) {}
18+
constructor(protected client: ClientType) { }
1919
public async getTags(
2020
options: {
2121
first?: number;
2222
page?: number;
2323
where?: WhereCondition;
24-
orderBy?: OrderBy;
24+
orderBy?: OrderBy[];
2525
search?: string;
2626
} = {}
2727
): Promise<CreatedTags> {
28-
29-
const { first, page, where, search, orderBy } = options;
28+
29+
const { first, page, where, search, orderBy } = options;
3030

3131
const response = await this.client.query({
3232
query: GET_TAGS,

test/tags.test.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { initializeClient, getClient } from './setupClient';
2+
3+
beforeAll(async () => {
4+
await initializeClient();
5+
});
6+
7+
describe('Test the Soc', () => {
8+
it('get tags', async () => {
9+
const client = getClient();
10+
const tags = client.tags;
11+
const tagList = await tags.getTags({
12+
where: { column: 'IS_FEATURE', operator: 'EQ', value: 1 },
13+
orderBy: [{ column: 'WEIGHT', order: 'ASC' }],
14+
});
15+
16+
expect(tagList).toBeDefined();
17+
});
18+
});

0 commit comments

Comments
 (0)