PLT-2643 Fixed asynchronous autocomplete incorrectly replacing text (#3167)
* Allowed different suggestions to match different text. Added a Suggestion base component. Improved text replacement used when filling in suggestions * Fixed formatting
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
6e6257fcca
Коммит
12f6593727
20
webapp/tests/suggestion_box.test.jsx
Обычный файл
20
webapp/tests/suggestion_box.test.jsx
Обычный файл
@@ -0,0 +1,20 @@
|
||||
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
|
||||
// See License.txt for license information.
|
||||
|
||||
import assert from 'assert';
|
||||
|
||||
import SuggestionBox from 'components/suggestion/suggestion_box.jsx';
|
||||
|
||||
describe('SuggestionBox', function() {
|
||||
it('findOverlap', function(done) {
|
||||
assert.equal(SuggestionBox.findOverlap('', 'blue'), '');
|
||||
assert.equal(SuggestionBox.findOverlap('red', ''), '');
|
||||
assert.equal(SuggestionBox.findOverlap('red', 'blue'), '');
|
||||
assert.equal(SuggestionBox.findOverlap('red', 'dog'), 'd');
|
||||
assert.equal(SuggestionBox.findOverlap('red', 'education'), 'ed');
|
||||
assert.equal(SuggestionBox.findOverlap('red', 'reduce'), 'red');
|
||||
assert.equal(SuggestionBox.findOverlap('black', 'ack'), 'ack');
|
||||
|
||||
done();
|
||||
});
|
||||
});
|
||||
Ссылка в новой задаче
Block a user