From 4d6f005983d77d4de9f88838ce5b51e80570acc0 Mon Sep 17 00:00:00 2001 From: Maria Hutt Date: Thu, 7 Sep 2023 17:04:02 -0700 Subject: [PATCH] feat(angular): update tests --- .../official/blank/src/app/app.component.ts | 15 +++++++++++++++ .../official/list/src/app/app.component.spec.ts | 1 - .../official/list/src/app/app.component.ts | 15 +++++++++++++++ .../src/app/message/message.component.spec.ts | 4 ++-- .../app/view-message/view-message.page.spec.ts | 4 ++-- .../sidemenu/src/app/app.component.spec.ts | 3 ++- .../sidemenu/src/app/folder/folder.page.spec.ts | 4 ++-- 7 files changed, 38 insertions(+), 8 deletions(-) create mode 100644 angular-standalone/official/blank/src/app/app.component.ts create mode 100644 angular-standalone/official/list/src/app/app.component.ts diff --git a/angular-standalone/official/blank/src/app/app.component.ts b/angular-standalone/official/blank/src/app/app.component.ts new file mode 100644 index 000000000..b6753e980 --- /dev/null +++ b/angular-standalone/official/blank/src/app/app.component.ts @@ -0,0 +1,15 @@ +import { Component, EnvironmentInjector, inject } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { IonApp, IonRouterOutlet } from '@ionic/angular/standalone'; + +@Component({ + selector: 'app-root', + templateUrl: 'app.component.html', + standalone: true, + imports: [CommonModule, IonApp, IonRouterOutlet], +}) +export class AppComponent { + public environmentInjector = inject(EnvironmentInjector); + + constructor() {} +} diff --git a/angular-standalone/official/list/src/app/app.component.spec.ts b/angular-standalone/official/list/src/app/app.component.spec.ts index 6edde74a2..5fd1ccefa 100644 --- a/angular-standalone/official/list/src/app/app.component.spec.ts +++ b/angular-standalone/official/list/src/app/app.component.spec.ts @@ -1,6 +1,5 @@ import { TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; -import { IonicModule } from '@ionic/angular'; import { AppComponent } from './app.component'; diff --git a/angular-standalone/official/list/src/app/app.component.ts b/angular-standalone/official/list/src/app/app.component.ts new file mode 100644 index 000000000..b6753e980 --- /dev/null +++ b/angular-standalone/official/list/src/app/app.component.ts @@ -0,0 +1,15 @@ +import { Component, EnvironmentInjector, inject } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { IonApp, IonRouterOutlet } from '@ionic/angular/standalone'; + +@Component({ + selector: 'app-root', + templateUrl: 'app.component.html', + standalone: true, + imports: [CommonModule, IonApp, IonRouterOutlet], +}) +export class AppComponent { + public environmentInjector = inject(EnvironmentInjector); + + constructor() {} +} diff --git a/angular-standalone/official/list/src/app/message/message.component.spec.ts b/angular-standalone/official/list/src/app/message/message.component.spec.ts index 6141cfee0..4a3e2cf58 100644 --- a/angular-standalone/official/list/src/app/message/message.component.spec.ts +++ b/angular-standalone/official/list/src/app/message/message.component.spec.ts @@ -1,6 +1,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { provideRouter } from '@angular/router'; -import { IonicModule } from '@ionic/angular'; +import { IonItem, IonLabel, IonNote, IonIcon } from '@ionic/angular/standalone'; import { ViewMessagePage } from '../view-message/view-message.page'; import { MessageComponent } from './message.component'; @@ -11,7 +11,7 @@ describe('MessageComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [MessageComponent, IonicModule, ViewMessagePage], + imports: [IonItem, IonLabel, IonNote, IonIcon, MessageComponent, ViewMessagePage], providers: [provideRouter([])] }).compileComponents(); diff --git a/angular-standalone/official/list/src/app/view-message/view-message.page.spec.ts b/angular-standalone/official/list/src/app/view-message/view-message.page.spec.ts index 2f844ccdb..667596914 100644 --- a/angular-standalone/official/list/src/app/view-message/view-message.page.spec.ts +++ b/angular-standalone/official/list/src/app/view-message/view-message.page.spec.ts @@ -1,6 +1,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; import { provideRouter } from '@angular/router'; +import { IonHeader, IonToolbar, IonButtons, IonBackButton, IonContent, IonItem, IonIcon, IonLabel, IonNote } from '@ionic/angular/standalone'; import { ViewMessagePage } from './view-message.page'; @@ -10,7 +10,7 @@ describe('ViewMessagePage', () => { beforeEach(async () => { TestBed.configureTestingModule({ - imports: [ViewMessagePage, IonicModule], + imports: [IonHeader, IonToolbar, IonButtons, IonBackButton, IonContent, IonItem, IonIcon, IonLabel, IonNote, ViewMessagePage], providers: [provideRouter([])], }).compileComponents(); diff --git a/angular-standalone/official/sidemenu/src/app/app.component.spec.ts b/angular-standalone/official/sidemenu/src/app/app.component.spec.ts index 98f1be72a..13eddfadd 100644 --- a/angular-standalone/official/sidemenu/src/app/app.component.spec.ts +++ b/angular-standalone/official/sidemenu/src/app/app.component.spec.ts @@ -1,5 +1,6 @@ import { TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; +import { IonApp, IonSplitPane, IonMenu, IonContent, IonList, IonListHeader, IonNote, IonMenuToggle, IonItem, IonIcon, IonLabel, IonRouterOutlet } from '@ionic/angular/standalone'; import { AppComponent } from './app.component'; @@ -7,7 +8,7 @@ describe('AppComponent', () => { beforeEach(async () => { TestBed.overrideComponent(AppComponent, { add: { - imports: [RouterTestingModule] + imports: [RouterTestingModule, IonApp, IonSplitPane, IonMenu, IonContent, IonList, IonListHeader, IonNote, IonMenuToggle, IonItem, IonIcon, IonLabel, IonRouterOutlet] } }); }); diff --git a/angular-standalone/official/sidemenu/src/app/folder/folder.page.spec.ts b/angular-standalone/official/sidemenu/src/app/folder/folder.page.spec.ts index 4c3d8572c..7f60f0316 100644 --- a/angular-standalone/official/sidemenu/src/app/folder/folder.page.spec.ts +++ b/angular-standalone/official/sidemenu/src/app/folder/folder.page.spec.ts @@ -1,6 +1,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; -import { IonicModule } from '@ionic/angular'; +import { IonHeader, IonToolbar, IonButtons, IonMenuButton, IonTitle, IonContent } from '@ionic/angular/standalone'; import { FolderPage } from './folder.page'; @@ -11,7 +11,7 @@ describe('FolderPage', () => { beforeEach(async () => { TestBed.overrideComponent(FolderPage, { add: { - imports: [RouterTestingModule] + imports: [RouterTestingModule, IonHeader, IonToolbar, IonButtons, IonMenuButton, IonTitle, IonContent] } });