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

exports[`Init MF --federationType=dynamic should create a host with the correct configurations 1`] = `
"import { setRemoteDefinitions } from '@nx/angular/mf';

fetch('/assets/module-federation.manifest.json')
  .then((res) => res.json())
  .then((definitions) => setRemoteDefinitions(definitions))
  .then(() => import('./bootstrap').catch((err) => console.error(err)));
"
`;

exports[`Init MF should add a remote application and add it to a specified host applications router config 1`] = `
"import { NxWelcomeComponent } from './nx-welcome.component';
import { Route } from '@angular/router';

export const appRoutes: Route[] = [
  {
    path: 'remote2',
    loadChildren: () =>
      import('remote2/Module').then((m) => m.RemoteEntryModule),
  },
  {
    path: 'remote1',
    loadChildren: () =>
      import('remote1/Module').then((m) => m.RemoteEntryModule),
  },
  {
    path: '',
    component: NxWelcomeComponent,
  },
];
"
`;

exports[`Init MF should add a remote application and add it to a specified host applications webpack config that contains a remote application already 1`] = `
"module.exports = {
  name: 'app1',
  remotes: ['remote1', 'remote2'],
};
"
`;

exports[`Init MF should add a remote application and add it to a specified host applications webpack config when no other remote has been added to it 1`] = `
"module.exports = {
  name: 'app1',
  remotes: ['remote1'],
};
"
`;

exports[`Init MF should add a remote to dynamic host correctly 1`] = `
"import { NxWelcomeComponent } from './nx-welcome.component';
import { Route } from '@angular/router';
import { loadRemoteModule } from '@nx/angular/mf';

export const appRoutes: Route[] = [
  {
    path: 'remote1',
    loadChildren: () =>
      loadRemoteModule('remote1', './Module').then((m) => m.RemoteEntryModule),
  },
  {
    path: '',
    component: NxWelcomeComponent,
  },
];
"
`;

exports[`Init MF should create webpack and mf configs correctly 1`] = `
"const { withModuleFederation } = require('@nx/angular/module-federation');
const config = require('./module-federation.config');
module.exports = withModuleFederation(config);
"
`;

exports[`Init MF should create webpack and mf configs correctly 2`] = `
"module.exports = {
  name: 'app1',
  remotes: [],
};
"
`;

exports[`Init MF should create webpack and mf configs correctly 3`] = `
"const { withModuleFederation } = require('@nx/angular/module-federation');
const config = require('./module-federation.config');
module.exports = withModuleFederation(config);
"
`;

exports[`Init MF should create webpack and mf configs correctly 4`] = `
"module.exports = {
  name: 'remote1',
  exposes: {
    './Module': 'apps/remote1/src/app/remote-entry/entry.module.ts',
  },
};
"
`;

exports[`Init MF should generate the remote entry component correctly when prefix is not provided 1`] = `
"import { Component } from '@angular/core';

@Component({
  selector: 'proj-remote1-entry',
  template: \`<proj-nx-welcome></proj-nx-welcome>\`,
})
export class RemoteEntryComponent {}
"
`;

exports[`Init MF should generate the remote entry module and component correctly 1`] = `
"import { Component } from '@angular/core';

@Component({
  selector: 'my-org-remote1-entry',
  template: \`<my-org-nx-welcome></my-org-nx-welcome>\`,
})
export class RemoteEntryComponent {}
"
`;

exports[`Init MF should generate the remote entry module and component correctly 2`] = `
"import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

import { RemoteEntryComponent } from './entry.component';
import { NxWelcomeComponent } from './nx-welcome.component';

@NgModule({
  declarations: [RemoteEntryComponent, NxWelcomeComponent],
  imports: [CommonModule],
  providers: [],
  exports: [RemoteEntryComponent],
})
export class RemoteEntryModule {}
"
`;
