summaryrefslogtreecommitdiffstats
path: root/webapp/tests/suggestion_box.test.jsx.disable
blob: 6301482c20d68a9f2ca2de0ef92df97fcda39bc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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();
    });
});