Loading angular-cli.json→.angular-cli.json +24 −8 Original line number Diff line number Diff line { "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "project": { "version": "1.0.0-beta.17", "name": "angular2-mentions" }, "apps": [ { "root": "src", "outDir": "dist", "assets": "assets", "assets": [ "assets", "favicon.ico" ], "index": "index.html", "main": "main.ts", "polyfills": "polyfills.ts", "test": "test.ts", "tsconfig": "tsconfig.json", "prefix": "app", "mobile": false, "styles": [ "styles.css" ], "scripts": [], "tsconfig": "tsconfig.app.json", "testTsconfig": "tsconfig.spec.json", "environmentSource": "environments/environment.ts", "environments": { "source": "environments/environment.ts", "dev": "environments/environment.ts", "prod": "environments/environment.prod.ts" } } ], "addons": [], "packages": [], "e2e": { "protractor": { "config": "./protractor.conf.js" } }, "lint": [ { "project": "src/tsconfig.app.json" }, { "project": "src/tsconfig.spec.json" }, { "project": "e2e/tsconfig.e2e.json" } ], "test": { "karma": { "config": "./karma.conf.js" Loading @@ -39,6 +52,9 @@ }, "defaults": { "styleExt": "css", "prefixInterfaces": false "component": { "inlineTemplate": false, "spec": true } } } e2e/app.e2e-spec.ts +12 −12 Original line number Diff line number Diff line Loading @@ -37,6 +37,12 @@ describe('angular2-mentions App', function() { page.navigateTo(); expect(page.getHeadingText()).toEqual('Angular 2 Mentions'); let el = element.all(by.id('tmce_ifr')); // iframe testing workaround - sendKeys is not working unless menu is opened first // this wasn't needed in previous versions of angular/protractor el.click(); el.sendKeys('@'); el.sendKeys(protractor.Key.BACK_SPACE); // end iframe testing workaround testMentions(el); }); Loading @@ -44,10 +50,10 @@ describe('angular2-mentions App', function() { el.getTagName().then(function(tagName){ let menu = element(by.css('.dropdown-menu')); el.click(); expect(getValue(el, tagName)).toEqual(''); // popup menu el.sendKeys('Hello @'); browser.sleep(500); //browser.wait(EC.textToBePresentInElementValue(el, 'Hello @'), 1000); expect(menu.isDisplayed()).toBe(true); expect(getValue(el, tagName)).toEqual('Hello @'); Loading @@ -56,37 +62,31 @@ describe('angular2-mentions App', function() { //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(); browser.sleep(500); expect(menu.isDisplayed()).toBe(false); expect(getValue(el, tagName)).toEqual('Hello @Aaron'); // select another mention el.sendKeys(' and @gav', protractor.Key.ENTER); browser.sleep(500); expect(menu.isDisplayed()).toBe(false); expect(getValue(el, tagName)).toEqual('Hello @Aaron and @Gavin'); // start another mention el.sendKeys(' and @e'); browser.sleep(500); expect(menu.isDisplayed()).toBe(true); expect(getValue(el, tagName)).toEqual('Hello @Aaron and @Gavin and @e'); // but press escape instead el.sendKeys(protractor.Key.ESCAPE); browser.sleep(500); expect(menu.isDisplayed()).toBe(false); expect(getValue(el, tagName)).toEqual('Hello @Aaron and @Gavin and @e'); // remove the escaped entry el.sendKeys('!!', protractor.Key.ARROW_LEFT, protractor.Key.ARROW_LEFT); el.sendKeys(protractor.Key.BACK_SPACE, protractor.Key.BACK_SPACE); browser.sleep(500); expect(getValue(el, tagName)).toEqual('Hello @Aaron and @Gavin and !!'); // and insert another mention el.sendKeys('@he', protractor.Key.ENTER); browser.sleep(500); expect(menu.isDisplayed()).toBe(false); expect(getValue(el, tagName)).toEqual('Hello @Aaron and @Gavin and @Henry!!'); }); Loading @@ -101,9 +101,9 @@ describe('angular2-mentions App', function() { return browser.switchTo().frame(iframe).then( () => { let el = browser.driver.findElement(by.id('tinymce')); let text = el.getText(); browser.switchTo().defaultContent(); browser.waitForAngular(); return text; return browser.switchTo().defaultContent().then(()=>{ return browser.waitForAngular().then(()=>{return text}); }); }); } else { Loading e2e/tsconfig.json→e2e/tsconfig.e2e.json +10 −7 Original line number Diff line number Diff line { "compileOnSave": false, "compilerOptions": { "sourceMap": true, "declaration": false, "moduleResolution": "node", "emitDecoratorMetadata": true, "experimentalDecorators": true, "lib": [ "es2016" ], "outDir": "../out-tsc/e2e", "module": "commonjs", "moduleResolution": "node", "outDir": "../dist/out-tsc-e2e", "sourceMap": true, "target": "es5", "typeRoots": [ "../node_modules/@types" "types":[ "jasmine", "node" ] } } No newline at end of file karma.conf.js +14 −14 Original line number Diff line number Diff line Loading @@ -4,30 +4,30 @@ module.exports = function (config) { config.set({ basePath: '', frameworks: ['jasmine', 'angular-cli'], frameworks: ['jasmine', '@angular/cli'], plugins: [ require('karma-jasmine'), require('karma-chrome-launcher'), require('karma-remap-istanbul'), require('angular-cli/plugins/karma') require('karma-jasmine-html-reporter'), require('karma-coverage-istanbul-reporter'), require('@angular/cli/plugins/karma') ], client:{ clearContext: false // leave Jasmine Spec Runner output visible in browser }, files: [ { pattern: './src/test.ts', watched: false } ], preprocessors: { './src/test.ts': ['angular-cli'] }, remapIstanbulReporter: { reports: { html: 'coverage', lcovonly: './coverage/coverage.lcov' } './src/test.ts': ['@angular/cli'] }, angularCli: { config: './angular-cli.json', environment: 'dev' coverageIstanbulReporter: { reports: [ 'html', 'lcovonly' ], fixWebpackSourcePaths: true }, reporters: ['progress', 'karma-remap-istanbul'], reporters: config.angularCli && config.angularCli.codeCoverage ? ['progress', 'coverage-istanbul'] : ['progress', 'kjhtml'], port: 9876, colors: true, logLevel: config.LOG_INFO, Loading package.json +35 −39 Original line number Diff line number Diff line Loading @@ -16,51 +16,47 @@ "license": "MIT", "angular-cli": {}, "scripts": { "ng": "ng", "start": "ng serve", "lint": "tslint \"src/**/*.ts\"", "build": "ng build", "test": "ng test", "pree2e": "webdriver-manager update", "e2e": "protractor", "lint": "ng lint", "e2e": "ng e2e", "dist": "ngc -p src/mention" }, "private": false, "peerDependencies": { "@angular/common": "^2.0.0", "@angular/core": "^2.0.0", "@angular/forms": "^2.0.0", "@angular/platform-browser": "^2.0.0", "@angular/platform-browser-dynamic": "^2.0.0" "@angular/common": "^4.0.0", "@angular/core": "^4.0.0" }, "devDependencies": { "@types/jasmine": "^2.2.30", "@types/node": "^6.0.42", "@angular/compiler-cli": "2.1.2", "@angular/compiler": "2.1.2", "@angular/common": "2.1.2", "@angular/core": "2.1.2", "@angular/forms": "2.1.2", "@angular/platform-browser": "2.1.2", "@angular/platform-server": "2.1.2", "@angular/platform-browser-dynamic": "2.1.2", "@angular/http": "2.1.2", "@angular/router": "3.1.2", "core-js": "^2.4.1", "rxjs": "5.0.0-beta.12", "zone.js": "^0.6.23", "angular-cli": "^1.0.0-beta.17", "codelyzer": "~0.0.26", "jasmine-core": "2.4.1", "jasmine-spec-reporter": "2.5.0", "karma": "1.2.0", "karma-chrome-launcher": "^2.0.0", "karma-cli": "^1.0.1", "karma-jasmine": "^1.0.2", "karma-remap-istanbul": "^0.2.1", "protractor": "4.0.9", "ts-node": "1.2.1", "ts-helpers": "^1.1.1", "tslint": "3.13.0", "typescript": "2.0.2" "@angular/cli": "^1.0.0", "@angular/common": "^4.0.0", "@angular/compiler": "^4.0.0", "@angular/compiler-cli": "^4.0.0", "@angular/core": "^4.0.0", "@angular/forms": "^4.0.0", "@angular/platform-browser": "^4.0.0", "@angular/platform-browser-dynamic": "^4.0.0", "@angular/router": "^4.0.0", "@types/jasmine": "2.5.38", "@types/node": "^6.0.60", "codelyzer": "~2.0.0", "core-js": "~2.4.1", "jasmine-core": "~2.5.2", "jasmine-spec-reporter": "~3.2.0", "karma": "~1.4.1", "karma-chrome-launcher": "~2.0.0", "karma-cli": "~1.0.1", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "^0.2.2", "karma-coverage-istanbul-reporter": "^0.2.0", "protractor": "~5.1.0", "rxjs": "^5.1.0", "ts-node": "~2.0.0", "tslint": "~4.5.0", "typescript": "~2.1.0", "zone.js": "^0.8.4" }, "files": [ "mention" Loading Loading
angular-cli.json→.angular-cli.json +24 −8 Original line number Diff line number Diff line { "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "project": { "version": "1.0.0-beta.17", "name": "angular2-mentions" }, "apps": [ { "root": "src", "outDir": "dist", "assets": "assets", "assets": [ "assets", "favicon.ico" ], "index": "index.html", "main": "main.ts", "polyfills": "polyfills.ts", "test": "test.ts", "tsconfig": "tsconfig.json", "prefix": "app", "mobile": false, "styles": [ "styles.css" ], "scripts": [], "tsconfig": "tsconfig.app.json", "testTsconfig": "tsconfig.spec.json", "environmentSource": "environments/environment.ts", "environments": { "source": "environments/environment.ts", "dev": "environments/environment.ts", "prod": "environments/environment.prod.ts" } } ], "addons": [], "packages": [], "e2e": { "protractor": { "config": "./protractor.conf.js" } }, "lint": [ { "project": "src/tsconfig.app.json" }, { "project": "src/tsconfig.spec.json" }, { "project": "e2e/tsconfig.e2e.json" } ], "test": { "karma": { "config": "./karma.conf.js" Loading @@ -39,6 +52,9 @@ }, "defaults": { "styleExt": "css", "prefixInterfaces": false "component": { "inlineTemplate": false, "spec": true } } }
e2e/app.e2e-spec.ts +12 −12 Original line number Diff line number Diff line Loading @@ -37,6 +37,12 @@ describe('angular2-mentions App', function() { page.navigateTo(); expect(page.getHeadingText()).toEqual('Angular 2 Mentions'); let el = element.all(by.id('tmce_ifr')); // iframe testing workaround - sendKeys is not working unless menu is opened first // this wasn't needed in previous versions of angular/protractor el.click(); el.sendKeys('@'); el.sendKeys(protractor.Key.BACK_SPACE); // end iframe testing workaround testMentions(el); }); Loading @@ -44,10 +50,10 @@ describe('angular2-mentions App', function() { el.getTagName().then(function(tagName){ let menu = element(by.css('.dropdown-menu')); el.click(); expect(getValue(el, tagName)).toEqual(''); // popup menu el.sendKeys('Hello @'); browser.sleep(500); //browser.wait(EC.textToBePresentInElementValue(el, 'Hello @'), 1000); expect(menu.isDisplayed()).toBe(true); expect(getValue(el, tagName)).toEqual('Hello @'); Loading @@ -56,37 +62,31 @@ describe('angular2-mentions App', function() { //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(); browser.sleep(500); expect(menu.isDisplayed()).toBe(false); expect(getValue(el, tagName)).toEqual('Hello @Aaron'); // select another mention el.sendKeys(' and @gav', protractor.Key.ENTER); browser.sleep(500); expect(menu.isDisplayed()).toBe(false); expect(getValue(el, tagName)).toEqual('Hello @Aaron and @Gavin'); // start another mention el.sendKeys(' and @e'); browser.sleep(500); expect(menu.isDisplayed()).toBe(true); expect(getValue(el, tagName)).toEqual('Hello @Aaron and @Gavin and @e'); // but press escape instead el.sendKeys(protractor.Key.ESCAPE); browser.sleep(500); expect(menu.isDisplayed()).toBe(false); expect(getValue(el, tagName)).toEqual('Hello @Aaron and @Gavin and @e'); // remove the escaped entry el.sendKeys('!!', protractor.Key.ARROW_LEFT, protractor.Key.ARROW_LEFT); el.sendKeys(protractor.Key.BACK_SPACE, protractor.Key.BACK_SPACE); browser.sleep(500); expect(getValue(el, tagName)).toEqual('Hello @Aaron and @Gavin and !!'); // and insert another mention el.sendKeys('@he', protractor.Key.ENTER); browser.sleep(500); expect(menu.isDisplayed()).toBe(false); expect(getValue(el, tagName)).toEqual('Hello @Aaron and @Gavin and @Henry!!'); }); Loading @@ -101,9 +101,9 @@ describe('angular2-mentions App', function() { return browser.switchTo().frame(iframe).then( () => { let el = browser.driver.findElement(by.id('tinymce')); let text = el.getText(); browser.switchTo().defaultContent(); browser.waitForAngular(); return text; return browser.switchTo().defaultContent().then(()=>{ return browser.waitForAngular().then(()=>{return text}); }); }); } else { Loading
e2e/tsconfig.json→e2e/tsconfig.e2e.json +10 −7 Original line number Diff line number Diff line { "compileOnSave": false, "compilerOptions": { "sourceMap": true, "declaration": false, "moduleResolution": "node", "emitDecoratorMetadata": true, "experimentalDecorators": true, "lib": [ "es2016" ], "outDir": "../out-tsc/e2e", "module": "commonjs", "moduleResolution": "node", "outDir": "../dist/out-tsc-e2e", "sourceMap": true, "target": "es5", "typeRoots": [ "../node_modules/@types" "types":[ "jasmine", "node" ] } } No newline at end of file
karma.conf.js +14 −14 Original line number Diff line number Diff line Loading @@ -4,30 +4,30 @@ module.exports = function (config) { config.set({ basePath: '', frameworks: ['jasmine', 'angular-cli'], frameworks: ['jasmine', '@angular/cli'], plugins: [ require('karma-jasmine'), require('karma-chrome-launcher'), require('karma-remap-istanbul'), require('angular-cli/plugins/karma') require('karma-jasmine-html-reporter'), require('karma-coverage-istanbul-reporter'), require('@angular/cli/plugins/karma') ], client:{ clearContext: false // leave Jasmine Spec Runner output visible in browser }, files: [ { pattern: './src/test.ts', watched: false } ], preprocessors: { './src/test.ts': ['angular-cli'] }, remapIstanbulReporter: { reports: { html: 'coverage', lcovonly: './coverage/coverage.lcov' } './src/test.ts': ['@angular/cli'] }, angularCli: { config: './angular-cli.json', environment: 'dev' coverageIstanbulReporter: { reports: [ 'html', 'lcovonly' ], fixWebpackSourcePaths: true }, reporters: ['progress', 'karma-remap-istanbul'], reporters: config.angularCli && config.angularCli.codeCoverage ? ['progress', 'coverage-istanbul'] : ['progress', 'kjhtml'], port: 9876, colors: true, logLevel: config.LOG_INFO, Loading
package.json +35 −39 Original line number Diff line number Diff line Loading @@ -16,51 +16,47 @@ "license": "MIT", "angular-cli": {}, "scripts": { "ng": "ng", "start": "ng serve", "lint": "tslint \"src/**/*.ts\"", "build": "ng build", "test": "ng test", "pree2e": "webdriver-manager update", "e2e": "protractor", "lint": "ng lint", "e2e": "ng e2e", "dist": "ngc -p src/mention" }, "private": false, "peerDependencies": { "@angular/common": "^2.0.0", "@angular/core": "^2.0.0", "@angular/forms": "^2.0.0", "@angular/platform-browser": "^2.0.0", "@angular/platform-browser-dynamic": "^2.0.0" "@angular/common": "^4.0.0", "@angular/core": "^4.0.0" }, "devDependencies": { "@types/jasmine": "^2.2.30", "@types/node": "^6.0.42", "@angular/compiler-cli": "2.1.2", "@angular/compiler": "2.1.2", "@angular/common": "2.1.2", "@angular/core": "2.1.2", "@angular/forms": "2.1.2", "@angular/platform-browser": "2.1.2", "@angular/platform-server": "2.1.2", "@angular/platform-browser-dynamic": "2.1.2", "@angular/http": "2.1.2", "@angular/router": "3.1.2", "core-js": "^2.4.1", "rxjs": "5.0.0-beta.12", "zone.js": "^0.6.23", "angular-cli": "^1.0.0-beta.17", "codelyzer": "~0.0.26", "jasmine-core": "2.4.1", "jasmine-spec-reporter": "2.5.0", "karma": "1.2.0", "karma-chrome-launcher": "^2.0.0", "karma-cli": "^1.0.1", "karma-jasmine": "^1.0.2", "karma-remap-istanbul": "^0.2.1", "protractor": "4.0.9", "ts-node": "1.2.1", "ts-helpers": "^1.1.1", "tslint": "3.13.0", "typescript": "2.0.2" "@angular/cli": "^1.0.0", "@angular/common": "^4.0.0", "@angular/compiler": "^4.0.0", "@angular/compiler-cli": "^4.0.0", "@angular/core": "^4.0.0", "@angular/forms": "^4.0.0", "@angular/platform-browser": "^4.0.0", "@angular/platform-browser-dynamic": "^4.0.0", "@angular/router": "^4.0.0", "@types/jasmine": "2.5.38", "@types/node": "^6.0.60", "codelyzer": "~2.0.0", "core-js": "~2.4.1", "jasmine-core": "~2.5.2", "jasmine-spec-reporter": "~3.2.0", "karma": "~1.4.1", "karma-chrome-launcher": "~2.0.0", "karma-cli": "~1.0.1", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "^0.2.2", "karma-coverage-istanbul-reporter": "^0.2.0", "protractor": "~5.1.0", "rxjs": "^5.1.0", "ts-node": "~2.0.0", "tslint": "~4.5.0", "typescript": "~2.1.0", "zone.js": "^0.8.4" }, "files": [ "mention" Loading