Skip to content

Commit

Permalink
feat(angular): update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thetaPC committed Sep 8, 2023
1 parent 1b7f26e commit 4d6f005
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 8 deletions.
15 changes: 15 additions & 0 deletions angular-standalone/official/blank/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -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() {}
}
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
15 changes: 15 additions & 0 deletions angular-standalone/official/list/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -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() {}
}
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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();

Expand Down
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -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();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
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';

describe('AppComponent', () => {
beforeEach(async () => {
TestBed.overrideComponent(AppComponent, {
add: {
imports: [RouterTestingModule]
imports: [RouterTestingModule, IonApp, IonSplitPane, IonMenu, IonContent, IonList, IonListHeader, IonNote, IonMenuToggle, IonItem, IonIcon, IonLabel, IonRouterOutlet]
}
});
});
Expand Down
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -11,7 +11,7 @@ describe('FolderPage', () => {
beforeEach(async () => {
TestBed.overrideComponent(FolderPage, {
add: {
imports: [RouterTestingModule]
imports: [RouterTestingModule, IonHeader, IonToolbar, IonButtons, IonMenuButton, IonTitle, IonContent]
}
});

Expand Down

0 comments on commit 4d6f005

Please sign in to comment.