File tree Expand file tree Collapse file tree 5 files changed +32
-10
lines changed
test/Functional/Apisearch Expand file tree Collapse file tree 5 files changed +32
-10
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " apisearch" ,
3
- "version" : " 0.2.30 " ,
3
+ "version" : " 0.2.31 " ,
4
4
"description" : " Javascript client for Apisearch." ,
5
5
"main" : " lib/index.js" ,
6
6
"types" : " lib/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ export class AxiosClient extends Client implements HttpClient {
87
87
...{
88
88
token : credentials . token ,
89
89
} ,
90
- } ) ,
90
+ } ) . replace ( / # / g , '%23' ) ,
91
91
} ;
92
92
93
93
if ( typeof this . cancelToken [ url ] !== "undefined" ) {
Original file line number Diff line number Diff line change @@ -2,15 +2,16 @@ import Axios from "axios";
2
2
import { expect } from "chai" ;
3
3
import * as sinon from "sinon" ;
4
4
import Apisearch from "../../../src/Apisearch" ;
5
- import { Config } from "../../../src/Config/Config" ;
6
- import { ConnectionError } from "../../../src/Error/ConnectionError" ;
7
- import { InvalidTokenError } from "../../../src/Error/InvalidTokenError" ;
8
- import { ResourceExistsError } from "../../../src/Error/ResourceExistsError" ;
9
- import { ResourceNotAvailableError } from "../../../src/Error/ResourceNotAvailableError" ;
10
5
import { UnknownError } from "../../../src/Error/UnknownError" ;
11
6
import { IndexUUID } from "../../../src/Model/IndexUUID" ;
12
- import { Query } from "../../../src/Query/Query" ;
13
7
import FunctionalTest from "./FunctionalTest" ;
8
+ import {
9
+ Config ,
10
+ ConnectionError ,
11
+ InvalidTokenError ,
12
+ Query , ResourceExistsError ,
13
+ ResourceNotAvailableError
14
+ } from "../../../src" ;
14
15
15
16
afterEach ( ( ) => {
16
17
sinon . restore ( ) ;
Original file line number Diff line number Diff line change 1
1
import Apisearch from "../../../src/Apisearch" ;
2
- import { HttpRepository } from "../../../src/Repository/HttpRepository " ;
2
+ import { HttpRepository } from "../../../src" ;
3
3
4
4
/**
5
5
* Apisearch class
@@ -15,10 +15,10 @@ export default class FunctionalTest {
15
15
return Apisearch . createRepository ( {
16
16
app_id : "789437438test" ,
17
17
index_id : "default" ,
18
+ token : "0e4d75ba-c640-44c1-a745-06ee51db4e93" ,
18
19
options : {
19
20
endpoint : "http://localhost:8000" ,
20
21
} ,
21
- token : "0e4d75ba-c640-44c1-a745-06ee51db4e93" ,
22
22
} ) ;
23
23
}
24
24
}
Original file line number Diff line number Diff line change @@ -227,4 +227,25 @@ describe('Apisearch', () => {
227
227
} ) ;
228
228
} ) ;
229
229
230
+
231
+ it ( 'should be able to work with strange characters' , async ( ) => {
232
+ const items = [
233
+ Item . create ( ItemUUID . createByComposedUUID ( '1~item' ) , {
234
+ 'name' : "strange # character"
235
+ } , { } , {
236
+ 'name' : 'strange # character'
237
+ } ) ,
238
+ ] ;
239
+
240
+ repository . addItems ( items ) ;
241
+ await repository . flush ( ) ;
242
+
243
+ await repository
244
+ . query ( Query
245
+ . create ( 'strange # char' )
246
+ )
247
+ . then ( result => {
248
+ expect ( result . getFirstItem ( ) . getUUID ( ) . getId ( ) ) . to . be . equal ( "1" ) ;
249
+ } ) ;
250
+ } ) ;
230
251
} ) ;
You can’t perform that action at this time.
0 commit comments