signal-desktop/ts/test-both/util/cleanSearchTerm_test.ts

14 lines
439 B
TypeScript
Raw Normal View History

// 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*');
});
});