signal-desktop/ts/test-both/util/cleanSearchTerm_test.ts
rhklee 8b51f174d8
Remove backslash from search queries
Co-authored-by: Lee Randy <randy.lee@metronom.com>
Co-authored-by: Evan Hahn <69474926+EvanHahn-Signal@users.noreply.github.com>

See [#5053][0].

[0]: https://github.com/signalapp/Signal-Desktop/pull/5053
2021-04-02 15:29:54 -05:00

13 lines
439 B
TypeScript

// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { assert } from 'chai';
import { cleanSearchTerm } from '../../util/cleanSearchTerm';
describe('cleanSearchTerm', () => {
it('should remove \\ from a search term', () => {
const searchTerm = '\\search\\term';
const sanitizedSearchTerm = cleanSearchTerm(searchTerm);
assert.strictEqual(sanitizedSearchTerm, 'search* term*');
});
});