-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgh-user-repos.component.spec.ts
More file actions
45 lines (40 loc) · 1.22 KB
/
Copy pathgh-user-repos.component.spec.ts
File metadata and controls
45 lines (40 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { Component, input, inputBinding } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { GhFullUser, GhUserRepo } from '@gh/shared/models';
import { describe, expect, test } from 'vitest';
import { GhUserReposComponent } from './gh-user-repos.component';
@Component({
selector: 'gh-user',
standalone: true,
template: '',
})
class GhUserReposMockComponent {
user = input.required<GhFullUser | undefined>();
repos = input.required<GhUserRepo[]>();
}
describe('GhUserReposComponent', () => {
let component: GhUserReposComponent;
let fixture: ComponentFixture<GhUserReposComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [GhUserReposComponent],
})
.overrideComponent(GhUserReposComponent, {
remove: {
imports: [GhUserReposComponent],
},
add: {
imports: [GhUserReposMockComponent],
},
})
.compileComponents();
fixture = TestBed.createComponent(GhUserReposComponent, {
bindings: [inputBinding('user', () => undefined), inputBinding('repos', () => [])],
});
component = fixture.componentInstance;
fixture.detectChanges();
});
test('should create', () => {
expect(component).toBeTruthy();
});
});