// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`app --minimal should skip "nx-welcome.component.ts" file and references for non-standalone apps with routing 1`] = `
"import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouterModule } from '@angular/router';
import { AppComponent } from './app.component';
import { appRoutes } from './app.routes';

@NgModule({
  declarations: [AppComponent],
  imports: [
    BrowserModule,
    RouterModule.forRoot(appRoutes, { initialNavigation: 'enabledBlocking' }),
  ],
  providers: [],
  bootstrap: [AppComponent],
})
export class AppModule {}
"
`;

exports[`app --minimal should skip "nx-welcome.component.ts" file and references for non-standalone apps with routing 2`] = `
"import { Component } from '@angular/core';

@Component({
  selector: 'proj-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css'],
})
export class AppComponent {}
"
`;

exports[`app --minimal should skip "nx-welcome.component.ts" file and references for non-standalone apps with routing 3`] = `
"import { TestBed } from '@angular/core/testing';
import { AppComponent } from './app.component';
import { RouterTestingModule } from '@angular/router/testing';

describe('AppComponent', () => {
  beforeEach(async () => {
    await TestBed.configureTestingModule({
      imports: [RouterTestingModule],
      declarations: [AppComponent],
    }).compileComponents();
  });

  it('should render title', () => {
    const fixture = TestBed.createComponent(AppComponent);
    fixture.detectChanges();
    const compiled = fixture.nativeElement as HTMLElement;
    expect(compiled.querySelector('h1')?.textContent).toContain(
      'Welcome plain'
    );
  });
});
"
`;

exports[`app --minimal should skip "nx-welcome.component.ts" file and references for non-standalone apps with routing 4`] = `
"<h1>Welcome plain</h1>
<router-outlet></router-outlet>
"
`;

exports[`app --minimal should skip "nx-welcome.component.ts" file and references for non-standalone apps without routing 1`] = `
"import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [AppComponent],
  imports: [BrowserModule],
  providers: [],
  bootstrap: [AppComponent],
})
export class AppModule {}
"
`;

exports[`app --minimal should skip "nx-welcome.component.ts" file and references for non-standalone apps without routing 2`] = `
"import { Component } from '@angular/core';

@Component({
  selector: 'proj-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css'],
})
export class AppComponent {}
"
`;

exports[`app --minimal should skip "nx-welcome.component.ts" file and references for non-standalone apps without routing 3`] = `
"import { TestBed } from '@angular/core/testing';
import { AppComponent } from './app.component';

describe('AppComponent', () => {
  beforeEach(async () => {
    await TestBed.configureTestingModule({
      imports: [],
      declarations: [AppComponent],
    }).compileComponents();
  });

  it('should render title', () => {
    const fixture = TestBed.createComponent(AppComponent);
    fixture.detectChanges();
    const compiled = fixture.nativeElement as HTMLElement;
    expect(compiled.querySelector('h1')?.textContent).toContain(
      'Welcome plain'
    );
  });
});
"
`;

exports[`app --minimal should skip "nx-welcome.component.ts" file and references for non-standalone apps without routing 4`] = `
"<h1>Welcome plain</h1>
"
`;

exports[`app --minimal should skip "nx-welcome.component.ts" file and references for standalone apps with routing 1`] = `
"import { Component } from '@angular/core';
import { RouterModule } from '@angular/router';

@Component({
  standalone: true,
  imports: [RouterModule],
  selector: 'proj-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css'],
})
export class AppComponent {}
"
`;

exports[`app --minimal should skip "nx-welcome.component.ts" file and references for standalone apps with routing 2`] = `
"import { TestBed } from '@angular/core/testing';
import { AppComponent } from './app.component';
import { RouterTestingModule } from '@angular/router/testing';

describe('AppComponent', () => {
  beforeEach(async () => {
    await TestBed.configureTestingModule({
      imports: [AppComponent, RouterTestingModule],
    }).compileComponents();
  });

  it('should render title', () => {
    const fixture = TestBed.createComponent(AppComponent);
    fixture.detectChanges();
    const compiled = fixture.nativeElement as HTMLElement;
    expect(compiled.querySelector('h1')?.textContent).toContain(
      'Welcome plain'
    );
  });
});
"
`;

exports[`app --minimal should skip "nx-welcome.component.ts" file and references for standalone apps with routing 3`] = `
"<h1>Welcome plain</h1>
<router-outlet></router-outlet>
"
`;

exports[`app --minimal should skip "nx-welcome.component.ts" file and references for standalone apps without routing 1`] = `
"import { Component } from '@angular/core';

@Component({
  standalone: true,
  imports: [],
  selector: 'proj-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css'],
})
export class AppComponent {}
"
`;

exports[`app --minimal should skip "nx-welcome.component.ts" file and references for standalone apps without routing 2`] = `
"import { TestBed } from '@angular/core/testing';
import { AppComponent } from './app.component';

describe('AppComponent', () => {
  beforeEach(async () => {
    await TestBed.configureTestingModule({
      imports: [AppComponent],
    }).compileComponents();
  });

  it('should render title', () => {
    const fixture = TestBed.createComponent(AppComponent);
    fixture.detectChanges();
    const compiled = fixture.nativeElement as HTMLElement;
    expect(compiled.querySelector('h1')?.textContent).toContain(
      'Welcome plain'
    );
  });
});
"
`;

exports[`app --minimal should skip "nx-welcome.component.ts" file and references for standalone apps without routing 3`] = `
"<h1>Welcome plain</h1>
"
`;

exports[`app --standalone should generate a standalone app correctly with routing 1`] = `
"import { bootstrapApplication } from '@angular/platform-browser';
import { appConfig } from './app/app.config';
import { AppComponent } from './app/app.component';

bootstrapApplication(AppComponent, appConfig).catch((err) =>
  console.error(err)
);
"
`;

exports[`app --standalone should generate a standalone app correctly with routing 2`] = `
"import { ApplicationConfig } from '@angular/core';
import {
  provideRouter,
  withEnabledBlockingInitialNavigation,
} from '@angular/router';
import { appRoutes } from './app.routes';

export const appConfig: ApplicationConfig = {
  providers: [provideRouter(appRoutes, withEnabledBlockingInitialNavigation())],
};
"
`;

exports[`app --standalone should generate a standalone app correctly with routing 3`] = `
"import { Route } from '@angular/router';

export const appRoutes: Route[] = [];
"
`;

exports[`app --standalone should generate a standalone app correctly with routing 4`] = `
"import { Component } from '@angular/core';
import { RouterModule } from '@angular/router';
import { NxWelcomeComponent } from './nx-welcome.component';

@Component({
  standalone: true,
  imports: [NxWelcomeComponent, RouterModule],
  selector: 'proj-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css'],
})
export class AppComponent {
  title = 'standalone';
}
"
`;

exports[`app --standalone should generate a standalone app correctly with routing 5`] = `
"import { TestBed } from '@angular/core/testing';
import { AppComponent } from './app.component';
import { NxWelcomeComponent } from './nx-welcome.component';
import { RouterTestingModule } from '@angular/router/testing';

describe('AppComponent', () => {
  beforeEach(async () => {
    await TestBed.configureTestingModule({
      imports: [AppComponent, NxWelcomeComponent, RouterTestingModule],
    }).compileComponents();
  });

  it('should render title', () => {
    const fixture = TestBed.createComponent(AppComponent);
    fixture.detectChanges();
    const compiled = fixture.nativeElement as HTMLElement;
    expect(compiled.querySelector('h1')?.textContent).toContain(
      'Welcome standalone'
    );
  });

  it(\`should have as title 'standalone'\`, () => {
    const fixture = TestBed.createComponent(AppComponent);
    const app = fixture.componentInstance;
    expect(app.title).toEqual('standalone');
  });
});
"
`;

exports[`app --standalone should generate a standalone app correctly without routing 1`] = `
"import { bootstrapApplication } from '@angular/platform-browser';
import { appConfig } from './app/app.config';
import { AppComponent } from './app/app.component';

bootstrapApplication(AppComponent, appConfig).catch((err) =>
  console.error(err)
);
"
`;

exports[`app --standalone should generate a standalone app correctly without routing 2`] = `
"import { ApplicationConfig } from '@angular/core';

export const appConfig: ApplicationConfig = {
  providers: [],
};
"
`;

exports[`app --standalone should generate a standalone app correctly without routing 3`] = `
"import { Component } from '@angular/core';
import { NxWelcomeComponent } from './nx-welcome.component';

@Component({
  standalone: true,
  imports: [NxWelcomeComponent],
  selector: 'proj-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css'],
})
export class AppComponent {
  title = 'standalone';
}
"
`;

exports[`app --standalone should generate a standalone app correctly without routing 4`] = `
"import { TestBed } from '@angular/core/testing';
import { AppComponent } from './app.component';
import { NxWelcomeComponent } from './nx-welcome.component';

describe('AppComponent', () => {
  beforeEach(async () => {
    await TestBed.configureTestingModule({
      imports: [AppComponent, NxWelcomeComponent],
    }).compileComponents();
  });

  it('should render title', () => {
    const fixture = TestBed.createComponent(AppComponent);
    fixture.detectChanges();
    const compiled = fixture.nativeElement as HTMLElement;
    expect(compiled.querySelector('h1')?.textContent).toContain(
      'Welcome standalone'
    );
  });

  it(\`should have as title 'standalone'\`, () => {
    const fixture = TestBed.createComponent(AppComponent);
    const app = fixture.componentInstance;
    expect(app.title).toEqual('standalone');
  });
});
"
`;

exports[`app --strict should enable strict type checking: app tsconfig.json 1`] = `
{
  "angularCompilerOptions": {
    "enableI18nLegacyMessageIdFormat": false,
    "strictInjectionParameters": true,
    "strictInputAccessModifiers": true,
    "strictTemplates": true,
  },
  "compilerOptions": {
    "forceConsistentCasingInFileNames": true,
    "noFallthroughCasesInSwitch": true,
    "noImplicitOverride": true,
    "noImplicitReturns": true,
    "noPropertyAccessFromIndexSignature": true,
    "strict": true,
    "target": "es2022",
    "useDefineForClassFields": false,
  },
  "extends": "../../tsconfig.base.json",
  "files": [],
  "include": [],
  "references": [
    {
      "path": "./tsconfig.app.json",
    },
    {
      "path": "./tsconfig.spec.json",
    },
    {
      "path": "./tsconfig.editor.json",
    },
  ],
}
`;

exports[`app --strict should enable strict type checking: e2e tsconfig.json 1`] = `
{
  "compilerOptions": {
    "allowJs": true,
    "forceConsistentCasingInFileNames": true,
    "noFallthroughCasesInSwitch": true,
    "noImplicitOverride": true,
    "noImplicitReturns": true,
    "noPropertyAccessFromIndexSignature": true,
    "outDir": "../../dist/out-tsc",
    "sourceMap": false,
    "strict": true,
    "types": [
      "cypress",
      "node",
    ],
  },
  "extends": "../../tsconfig.base.json",
  "include": [
    "src/**/*.ts",
    "src/**/*.js",
    "cypress.config.ts",
  ],
}
`;

exports[`app at the root should accept numbers in the path 1`] = `"src/9-websites/my-app"`;

exports[`app nested should create project configs 1`] = `
{
  "$schema": "../../../node_modules/nx/schemas/project-schema.json",
  "name": "my-dir-my-app",
  "prefix": "proj",
  "projectType": "application",
  "root": "apps/my-dir/my-app",
  "sourceRoot": "apps/my-dir/my-app/src",
  "tags": [],
  "targets": {
    "build": {
      "configurations": {
        "development": {
          "buildOptimizer": false,
          "extractLicenses": false,
          "namedChunks": true,
          "optimization": false,
          "sourceMap": true,
          "vendorChunk": true,
        },
        "production": {
          "budgets": [
            {
              "maximumError": "1mb",
              "maximumWarning": "500kb",
              "type": "initial",
            },
            {
              "maximumError": "4kb",
              "maximumWarning": "2kb",
              "type": "anyComponentStyle",
            },
          ],
          "outputHashing": "all",
        },
      },
      "defaultConfiguration": "production",
      "executor": "@angular-devkit/build-angular:browser",
      "options": {
        "assets": [
          "apps/my-dir/my-app/src/favicon.ico",
          "apps/my-dir/my-app/src/assets",
        ],
        "index": "apps/my-dir/my-app/src/index.html",
        "main": "apps/my-dir/my-app/src/main.ts",
        "outputPath": "dist/apps/my-dir/my-app",
        "polyfills": [
          "zone.js",
        ],
        "scripts": [],
        "styles": [
          "apps/my-dir/my-app/src/styles.css",
        ],
        "tsConfig": "apps/my-dir/my-app/tsconfig.app.json",
      },
      "outputs": [
        "{options.outputPath}",
      ],
    },
    "extract-i18n": {
      "executor": "@angular-devkit/build-angular:extract-i18n",
      "options": {
        "browserTarget": "my-dir-my-app:build",
      },
    },
    "lint": {
      "executor": "@nx/linter:eslint",
      "options": {
        "lintFilePatterns": [
          "apps/my-dir/my-app/**/*.ts",
          "apps/my-dir/my-app/**/*.html",
        ],
      },
      "outputs": [
        "{options.outputFile}",
      ],
    },
    "serve": {
      "configurations": {
        "development": {
          "browserTarget": "my-dir-my-app:build:development",
        },
        "production": {
          "browserTarget": "my-dir-my-app:build:production",
        },
      },
      "defaultConfiguration": "development",
      "executor": "@angular-devkit/build-angular:dev-server",
    },
    "serve-static": {
      "executor": "@nx/web:file-server",
      "options": {
        "buildTarget": "my-dir-my-app:build",
      },
    },
    "test": {
      "configurations": {
        "ci": {
          "ci": true,
          "codeCoverage": true,
        },
      },
      "executor": "@nx/jest:jest",
      "options": {
        "jestConfig": "apps/my-dir/my-app/jest.config.ts",
        "passWithNoTests": true,
      },
      "outputs": [
        "{workspaceRoot}/coverage/{projectRoot}",
      ],
    },
  },
}
`;

exports[`app nested should create project configs 2`] = `
{
  "$schema": "../../../node_modules/nx/schemas/project-schema.json",
  "implicitDependencies": [
    "my-dir-my-app",
  ],
  "name": "my-dir-my-app-e2e",
  "projectType": "application",
  "root": "apps/my-dir/my-app-e2e",
  "sourceRoot": "apps/my-dir/my-app-e2e/src",
  "tags": [],
  "targets": {
    "e2e": {
      "configurations": {
        "ci": {
          "devServerTarget": "my-dir-my-app:serve-static",
        },
        "production": {
          "devServerTarget": "my-dir-my-app:serve:production",
        },
      },
      "executor": "@nx/cypress:cypress",
      "options": {
        "cypressConfig": "apps/my-dir/my-app-e2e/cypress.config.ts",
        "devServerTarget": "my-dir-my-app:serve:development",
        "testingType": "e2e",
      },
    },
    "lint": {
      "executor": "@nx/linter:eslint",
      "options": {
        "lintFilePatterns": [
          "apps/my-dir/my-app-e2e/**/*.{js,ts}",
        ],
      },
      "outputs": [
        "{options.outputFile}",
      ],
    },
  },
}
`;

exports[`app not nested should create project configs 1`] = `
{
  "$schema": "../../node_modules/nx/schemas/project-schema.json",
  "name": "my-app",
  "prefix": "proj",
  "projectType": "application",
  "root": "apps/my-app",
  "sourceRoot": "apps/my-app/src",
  "tags": [],
  "targets": {
    "build": {
      "configurations": {
        "development": {
          "buildOptimizer": false,
          "extractLicenses": false,
          "namedChunks": true,
          "optimization": false,
          "sourceMap": true,
          "vendorChunk": true,
        },
        "production": {
          "budgets": [
            {
              "maximumError": "1mb",
              "maximumWarning": "500kb",
              "type": "initial",
            },
            {
              "maximumError": "4kb",
              "maximumWarning": "2kb",
              "type": "anyComponentStyle",
            },
          ],
          "outputHashing": "all",
        },
      },
      "defaultConfiguration": "production",
      "executor": "@angular-devkit/build-angular:browser",
      "options": {
        "assets": [
          "apps/my-app/src/favicon.ico",
          "apps/my-app/src/assets",
        ],
        "index": "apps/my-app/src/index.html",
        "main": "apps/my-app/src/main.ts",
        "outputPath": "dist/apps/my-app",
        "polyfills": [
          "zone.js",
        ],
        "scripts": [],
        "styles": [
          "apps/my-app/src/styles.css",
        ],
        "tsConfig": "apps/my-app/tsconfig.app.json",
      },
      "outputs": [
        "{options.outputPath}",
      ],
    },
    "extract-i18n": {
      "executor": "@angular-devkit/build-angular:extract-i18n",
      "options": {
        "browserTarget": "my-app:build",
      },
    },
    "lint": {
      "executor": "@nx/linter:eslint",
      "options": {
        "lintFilePatterns": [
          "apps/my-app/**/*.ts",
          "apps/my-app/**/*.html",
        ],
      },
      "outputs": [
        "{options.outputFile}",
      ],
    },
    "serve": {
      "configurations": {
        "development": {
          "browserTarget": "my-app:build:development",
        },
        "production": {
          "browserTarget": "my-app:build:production",
        },
      },
      "defaultConfiguration": "development",
      "executor": "@angular-devkit/build-angular:dev-server",
    },
    "serve-static": {
      "executor": "@nx/web:file-server",
      "options": {
        "buildTarget": "my-app:build",
      },
    },
    "test": {
      "configurations": {
        "ci": {
          "ci": true,
          "codeCoverage": true,
        },
      },
      "executor": "@nx/jest:jest",
      "options": {
        "jestConfig": "apps/my-app/jest.config.ts",
        "passWithNoTests": true,
      },
      "outputs": [
        "{workspaceRoot}/coverage/{projectRoot}",
      ],
    },
  },
}
`;

exports[`app not nested should create project configs 2`] = `
{
  "$schema": "../../node_modules/nx/schemas/project-schema.json",
  "implicitDependencies": [
    "my-app",
  ],
  "name": "my-app-e2e",
  "projectType": "application",
  "root": "apps/my-app-e2e",
  "sourceRoot": "apps/my-app-e2e/src",
  "tags": [],
  "targets": {
    "e2e": {
      "configurations": {
        "ci": {
          "devServerTarget": "my-app:serve-static",
        },
        "production": {
          "devServerTarget": "my-app:serve:production",
        },
      },
      "executor": "@nx/cypress:cypress",
      "options": {
        "cypressConfig": "apps/my-app-e2e/cypress.config.ts",
        "devServerTarget": "my-app:serve:development",
        "testingType": "e2e",
      },
    },
    "lint": {
      "executor": "@nx/linter:eslint",
      "options": {
        "lintFilePatterns": [
          "apps/my-app-e2e/**/*.{js,ts}",
        ],
      },
      "outputs": [
        "{options.outputFile}",
      ],
    },
  },
}
`;

exports[`app not nested should generate files: e2e tsconfig.json 1`] = `
{
  "compilerOptions": {
    "allowJs": true,
    "forceConsistentCasingInFileNames": true,
    "noFallthroughCasesInSwitch": true,
    "noImplicitOverride": true,
    "noImplicitReturns": true,
    "noPropertyAccessFromIndexSignature": true,
    "outDir": "../../dist/out-tsc",
    "sourceMap": false,
    "strict": true,
    "types": [
      "cypress",
      "node",
    ],
  },
  "extends": "../../tsconfig.base.json",
  "include": [
    "src/**/*.ts",
    "src/**/*.js",
    "cypress.config.ts",
  ],
}
`;

exports[`app not nested should generate files: tsconfig.app.json 1`] = `
{
  "compilerOptions": {
    "outDir": "../../dist/out-tsc",
    "types": [],
  },
  "exclude": [
    "jest.config.ts",
    "src/**/*.test.ts",
    "src/**/*.spec.ts",
  ],
  "extends": "./tsconfig.json",
  "files": [
    "src/main.ts",
  ],
  "include": [
    "src/**/*.d.ts",
  ],
}
`;

exports[`app not nested should generate files: tsconfig.json 1`] = `
{
  "angularCompilerOptions": {
    "enableI18nLegacyMessageIdFormat": false,
    "strictInjectionParameters": true,
    "strictInputAccessModifiers": true,
    "strictTemplates": true,
  },
  "compilerOptions": {
    "forceConsistentCasingInFileNames": true,
    "noFallthroughCasesInSwitch": true,
    "noImplicitOverride": true,
    "noImplicitReturns": true,
    "noPropertyAccessFromIndexSignature": true,
    "strict": true,
    "target": "es2022",
    "useDefineForClassFields": false,
  },
  "extends": "../../tsconfig.base.json",
  "files": [],
  "include": [],
  "references": [
    {
      "path": "./tsconfig.app.json",
    },
    {
      "path": "./tsconfig.spec.json",
    },
    {
      "path": "./tsconfig.editor.json",
    },
  ],
}
`;
