Loading e2e/app.e2e-spec.ts +18 −4 Original line number Diff line number Diff line Loading @@ -54,12 +54,12 @@ describe('angular2-mentions App', function() { // popup menu el.sendKeys('Hello @'); //browser.wait(EC.textToBePresentInElementValue(el, 'Hello @'), 1000); expect(menu.isDisplayed()).toBe(true); expect(getValue(el, tagName)).toEqual('Hello @'); // select mention using arrow keys and pressing enter // el.sendKeys(protractor.Key.ARROW_DOWN, protractor.Key.ENTER); // select mention by clicking mouse on second item in menu element(by.css('.dropdown-menu li:nth-child(2) a')).click(); expect(menu.isDisplayed()).toBe(false); Loading @@ -70,8 +70,22 @@ describe('angular2-mentions App', function() { expect(menu.isDisplayed()).toBe(false); expect(getValue(el, tagName)).toEqual('Hello @Aaron and @Gavin'); // start another mention (with no values) el.sendKeys(' and @u'); expect(menu.isDisplayed()).toBe(false); expect(getValue(el, tagName)).toEqual('Hello @Aaron and @Gavin and @u'); // remove the mention el.sendKeys(protractor.Key.BACK_SPACE, protractor.Key.BACK_SPACE); expect(getValue(el, tagName)).toEqual('Hello @Aaron and @Gavin and '); // start another mention el.sendKeys(' and @e'); el.sendKeys('@'); expect(menu.isDisplayed()).toBe(true); expect(getValue(el, tagName)).toEqual('Hello @Aaron and @Gavin and @'); // continue the mention el.sendKeys('e'); expect(menu.isDisplayed()).toBe(true); expect(getValue(el, tagName)).toEqual('Hello @Aaron and @Gavin and @e'); Loading src/mention/mention.directive.ts +1 −0 Original line number Diff line number Diff line Loading @@ -154,6 +154,7 @@ export class MentionDirective implements OnInit, OnChanges { this.startPos = pos; this.startNode = (this.iframe ? this.iframe.contentWindow.getSelection() : window.getSelection()).anchorNode; this.stopSearch = false; this.searchString = null; this.showSearchList(nativeElement); this.updateSearchList(); } Loading Loading
e2e/app.e2e-spec.ts +18 −4 Original line number Diff line number Diff line Loading @@ -54,12 +54,12 @@ describe('angular2-mentions App', function() { // popup menu el.sendKeys('Hello @'); //browser.wait(EC.textToBePresentInElementValue(el, 'Hello @'), 1000); expect(menu.isDisplayed()).toBe(true); expect(getValue(el, tagName)).toEqual('Hello @'); // select mention using arrow keys and pressing enter // el.sendKeys(protractor.Key.ARROW_DOWN, protractor.Key.ENTER); // select mention by clicking mouse on second item in menu element(by.css('.dropdown-menu li:nth-child(2) a')).click(); expect(menu.isDisplayed()).toBe(false); Loading @@ -70,8 +70,22 @@ describe('angular2-mentions App', function() { expect(menu.isDisplayed()).toBe(false); expect(getValue(el, tagName)).toEqual('Hello @Aaron and @Gavin'); // start another mention (with no values) el.sendKeys(' and @u'); expect(menu.isDisplayed()).toBe(false); expect(getValue(el, tagName)).toEqual('Hello @Aaron and @Gavin and @u'); // remove the mention el.sendKeys(protractor.Key.BACK_SPACE, protractor.Key.BACK_SPACE); expect(getValue(el, tagName)).toEqual('Hello @Aaron and @Gavin and '); // start another mention el.sendKeys(' and @e'); el.sendKeys('@'); expect(menu.isDisplayed()).toBe(true); expect(getValue(el, tagName)).toEqual('Hello @Aaron and @Gavin and @'); // continue the mention el.sendKeys('e'); expect(menu.isDisplayed()).toBe(true); expect(getValue(el, tagName)).toEqual('Hello @Aaron and @Gavin and @e'); Loading
src/mention/mention.directive.ts +1 −0 Original line number Diff line number Diff line Loading @@ -154,6 +154,7 @@ export class MentionDirective implements OnInit, OnChanges { this.startPos = pos; this.startNode = (this.iframe ? this.iframe.contentWindow.getSelection() : window.getSelection()).anchorNode; this.stopSearch = false; this.searchString = null; this.showSearchList(nativeElement); this.updateSearchList(); } Loading