This repository was archived by the owner on Jun 25, 2025. It is now read-only.
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 11{
22 "name" : " apisearch" ,
3- "version" : " 0.2.30 " ,
3+ "version" : " 0.2.31 " ,
44 "description" : " Javascript client for Apisearch." ,
55 "main" : " lib/index.js" ,
66 "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 {
8787 ...{
8888 token : credentials . token ,
8989 } ,
90- } ) ,
90+ } ) . replace ( / # / g , '%23' ) ,
9191 } ;
9292
9393 if ( typeof this . cancelToken [ url ] !== "undefined" ) {
Original file line number Diff line number Diff line change @@ -2,15 +2,16 @@ import Axios from "axios";
22import { expect } from "chai" ;
33import * as sinon from "sinon" ;
44import 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" ;
105import { UnknownError } from "../../../src/Error/UnknownError" ;
116import { IndexUUID } from "../../../src/Model/IndexUUID" ;
12- import { Query } from "../../../src/Query/Query" ;
137import FunctionalTest from "./FunctionalTest" ;
8+ import {
9+ Config ,
10+ ConnectionError ,
11+ InvalidTokenError ,
12+ Query , ResourceExistsError ,
13+ ResourceNotAvailableError
14+ } from "../../../src" ;
1415
1516afterEach ( ( ) => {
1617 sinon . restore ( ) ;
Original file line number Diff line number Diff line change 11import Apisearch from "../../../src/Apisearch" ;
2- import { HttpRepository } from "../../../src/Repository/HttpRepository " ;
2+ import { HttpRepository } from "../../../src" ;
33
44/**
55 * Apisearch class
@@ -15,10 +15,10 @@ export default class FunctionalTest {
1515 return Apisearch . createRepository ( {
1616 app_id : "789437438test" ,
1717 index_id : "default" ,
18+ token : "0e4d75ba-c640-44c1-a745-06ee51db4e93" ,
1819 options : {
1920 endpoint : "http://localhost:8000" ,
2021 } ,
21- token : "0e4d75ba-c640-44c1-a745-06ee51db4e93" ,
2222 } ) ;
2323 }
2424}
Original file line number Diff line number Diff line change @@ -227,4 +227,25 @@ describe('Apisearch', () => {
227227 } ) ;
228228 } ) ;
229229
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+ } ) ;
230251} ) ;
You can’t perform that action at this time.
0 commit comments