Skip to content

Commit 8a4997b

Browse files
committed
add test of withNearVideo with all params
1 parent aaf9bd5 commit 8a4997b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/graphql/getter.test.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,6 +1109,26 @@ describe('nearMedia searchers', () => {
11091109
expect(mockClient.query).toHaveBeenCalledWith(expectedQuery);
11101110
});
11111111

1112+
test('a query with a valid nearVideo with all params', () => {
1113+
const mockClient: any = {
1114+
query: jest.fn(),
1115+
};
1116+
1117+
const expectedQuery = `{Get{Person(nearVideo:{video:"iVBORw0KGgoAAAANS",certainty:0.8,distance:0.6}){name}}}`;
1118+
1119+
new Getter(mockClient)
1120+
.withClassName('Person')
1121+
.withFields('name')
1122+
.withNearVideo({
1123+
video: 'iVBORw0KGgoAAAANS',
1124+
certainty: 0.8,
1125+
distance: 0.6,
1126+
})
1127+
.do();
1128+
1129+
expect(mockClient.query).toHaveBeenCalledWith(expectedQuery);
1130+
});
1131+
11121132
test('a query with a valid nearAudio', () => {
11131133
const mockClient: any = {
11141134
query: jest.fn(),

0 commit comments

Comments
 (0)