Skip to content

Commit

Permalink
fix: empty breadcrumb at start (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
udayvunnam authored Nov 17, 2020
1 parent 9ccf0df commit 8f08cf3
Show file tree
Hide file tree
Showing 43 changed files with 541 additions and 107 deletions.
112 changes: 112 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,118 @@
}
}
}
},
"simple-demo": {
"projectType": "application",
"schematics": {},
"root": "apps/simple-demo",
"sourceRoot": "apps/simple-demo/src",
"prefix": "xng",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/apps/simple-demo",
"index": "apps/simple-demo/src/index.html",
"main": "apps/simple-demo/src/main.ts",
"polyfills": "apps/simple-demo/src/polyfills.ts",
"tsConfig": "apps/simple-demo/tsconfig.app.json",
"aot": true,
"assets": [
"apps/simple-demo/src/favicon.ico",
"apps/simple-demo/src/assets"
],
"styles": ["apps/simple-demo/src/styles.css"],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "apps/simple-demo/src/environments/environment.ts",
"with": "apps/simple-demo/src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "simple-demo:build"
},
"configurations": {
"production": {
"browserTarget": "simple-demo:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "simple-demo:build"
}
},
"lint": {
"builder": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": ["apps/simple-demo/src/**/*.ts"]
}
},
"test": {
"builder": "@nrwl/jest:jest",
"options": {
"jestConfig": "apps/simple-demo/jest.config.js",
"passWithNoTests": true
}
}
}
},
"simple-demo-e2e": {
"root": "apps/simple-demo-e2e",
"sourceRoot": "apps/simple-demo-e2e/src",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@nrwl/cypress:cypress",
"options": {
"cypressConfig": "apps/simple-demo-e2e/cypress.json",
"tsConfig": "apps/simple-demo-e2e/tsconfig.e2e.json",
"devServerTarget": "simple-demo:serve"
},
"configurations": {
"production": {
"devServerTarget": "simple-demo:serve:production"
}
}
},
"lint": {
"builder": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": ["apps/simple-demo-e2e/**/*.{js,ts}"]
}
}
}
}
},
"cli": {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

33 changes: 0 additions & 33 deletions apps/demo/src/app/app.component.spec.ts

This file was deleted.

13 changes: 13 additions & 0 deletions apps/simple-demo-e2e/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": ["plugin:cypress/recommended", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["src/plugins/index.js"],
"rules": {
"@typescript-eslint/no-var-requires": "off",
"no-undef": "off"
}
}
]
}
12 changes: 12 additions & 0 deletions apps/simple-demo-e2e/cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"fileServerFolder": ".",
"fixturesFolder": "./src/fixtures",
"integrationFolder": "./src/integration",
"modifyObstructiveCode": false,
"pluginsFile": "./src/plugins/index",
"supportFile": "./src/support/index.ts",
"video": true,
"videosFolder": "../../dist/cypress/apps/simple-demo-e2e/videos",
"screenshotsFolder": "../../dist/cypress/apps/simple-demo-e2e/screenshots",
"chromeWebSecurity": false
}
4 changes: 4 additions & 0 deletions apps/simple-demo-e2e/src/fixtures/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "Using fixtures to represent data",
"email": "[email protected]"
}
8 changes: 8 additions & 0 deletions apps/simple-demo-e2e/src/integration/app.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
describe('simple-demo', () => {
it('should contain breadcrumbs for books', () => {
cy.visit('/');
cy.get('xng-breadcrumb').contains('FirstPage');
// shouldn't have default seperator if Home breadcrumb is not defined
cy.get('.xng-breadcrumb-list').contains('/').should('not.exist');
});
});
22 changes: 22 additions & 0 deletions apps/simple-demo-e2e/src/plugins/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/plugins-guide
// ***********************************************************

// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)

const { preprocessTypescript } = require('@nrwl/cypress/plugins/preprocessor');

module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config

// Preprocess Typescript file using Nx helper
on('file:preprocessor', preprocessTypescript(config));
};
1 change: 1 addition & 0 deletions apps/simple-demo-e2e/src/support/app.po.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const getGreeting = () => cy.get('h1');
33 changes: 33 additions & 0 deletions apps/simple-demo-e2e/src/support/commands.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************

// eslint-disable-next-line @typescript-eslint/no-namespace
declare namespace Cypress {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface Chainable<Subject> {
login(email: string, password: string): void;
}
}
//
// -- This is a parent command --
Cypress.Commands.add('login', (email, password) => {
console.log('Custom command example: Login', email, password);
});
//
// -- This is a child command --
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
17 changes: 17 additions & 0 deletions apps/simple-demo-e2e/src/support/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands';
10 changes: 10 additions & 0 deletions apps/simple-demo-e2e/tsconfig.e2e.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"sourceMap": false,
"outDir": "../../dist/out-tsc",
"allowJs": true,
"types": ["cypress", "node"]
},
"include": ["src/**/*.ts", "src/**/*.js"]
}
10 changes: 10 additions & 0 deletions apps/simple-demo-e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "../../tsconfig.base.json",
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.e2e.json"
}
]
}
18 changes: 18 additions & 0 deletions apps/simple-demo/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support

# You can see what browsers were selected by your queries by running:
# npx browserslist

last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
not IE 9-10 # Angular support for IE 9-10 has been deprecated and will be removed as of Angular v11. To opt-in, remove the 'not' prefix on this line.
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
1 change: 1 addition & 0 deletions apps/simple-demo/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "extends": "../../.eslintrc.json", "ignorePatterns": ["!**/*"], "rules": {} }
Loading

0 comments on commit 8f08cf3

Please sign in to comment.