From 4861b281b800acfee021bcf03874ce4217a08dc1 Mon Sep 17 00:00:00 2001 From: "Wataru.Kasahara" Date: Sat, 20 Apr 2024 12:38:22 +0900 Subject: [PATCH] =?UTF-8?q?test:=20view=20=E3=81=AE=E3=83=86=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=82=92=20Testing=20Library=20=E3=82=92=E4=BD=BF?= =?UTF-8?q?=E3=81=A3=E3=81=A6=E6=9B=B8=E3=81=8D=E6=8F=9B=E3=81=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ly-hero-search.component.spec.ts | 21 ++++++------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/src/app/features/dashboard/views/ly-hero-search/ly-hero-search.component.spec.ts b/src/app/features/dashboard/views/ly-hero-search/ly-hero-search.component.spec.ts index a6a996be..4db14088 100644 --- a/src/app/features/dashboard/views/ly-hero-search/ly-hero-search.component.spec.ts +++ b/src/app/features/dashboard/views/ly-hero-search/ly-hero-search.component.spec.ts @@ -1,22 +1,13 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - +import { render } from '@testing-library/angular'; +import { Hero } from '../../../../domain/hero'; import { LyHeroSearchComponent } from './ly-hero-search.component'; describe('LyHeroSearchComponent', () => { - let component: LyHeroSearchComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [LyHeroSearchComponent], - }).compileComponents(); - - fixture = TestBed.createComponent(LyHeroSearchComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); + it('should create', async () => { + const heroes: Hero[] = []; + const { fixture } = await render(LyHeroSearchComponent, { componentInputs: { heroes } }); + const component = fixture.componentInstance; - it('should create', () => { expect(component).toBeTruthy(); }); });