Skip to content

Commit

Permalink
chore: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
joaqcid committed Apr 15, 2024
1 parent a931371 commit 2b7710b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions integrations/standalone/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { TestBed } from '@angular/core/testing';
import { AppComponent } from './app.component';
import { importProvidersFrom } from '@angular/core';
import { NgxsModule } from '@ngxs/store';

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

Expand All @@ -17,13 +20,13 @@ describe('AppComponent', () => {
it(`should have the 'standalone' title`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app.name).toEqual('standalone');
expect(app.name).toEqual('Angular');
});

it('should render title', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, standalone');
expect(compiled.querySelector('h1')?.textContent).toContain('Hello from Angular!');
});
});
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
"angularCompilerOptions": {
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": false
"strictTemplates": true
}
}

0 comments on commit 2b7710b

Please sign in to comment.