This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it(`returns state 'active' when the due date is in the future`, ()=>{ | |
const futureTask = {...taskDtoMock}; | |
futureTask.dueDate = new Date(3000, 10, 10); | |
const taskViewModel = sut.taskToViewModel(futureTask); | |
expect(taskViewModel.state).toEqual('active'); | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ | |
selector: 'app-dummy-component', | |
templateUrl: './dummy-component.component.html', | |
}) | |
export class DummyComponent implements OnInit { | |
constructor(public route: ActivatedRoute) { | |
} | |
ngOnInit(): void { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ | |
selector: 'app-dummy-component', | |
templateUrl: './dummy-component.component.html', | |
}) | |
export class DummyComponent implements OnInit { | |
constructor(public route: ActivatedRoute) { | |
} | |
ngOnInit(): void { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
showAlert(data: SomeDataType) { | |
const alertString = Utils.getAlertText(data); | |
alert(alertString); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it('should open modal when linkText clicked', async () => { | |
// ARRANGE | |
await fixture.whenRenderingDone(); | |
// ACT | |
clickByTestAttr(fixture.debugElement, 'skillsPicker-linkText'); | |
await fixture.whenStable(); | |
// ASSERT | |
expect(modalService.open).toHaveBeenCalled(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('AppComponent', () => { | |
let component: AppComponent; | |
let fixture: ComponentFixture<AppComponent>; | |
let httpMock: HttpTestingController; | |
beforeEach(async(() => { | |
TestBed.configureTestingModule({ | |
imports: [HttpClientTestingModule], | |
declarations: [AppComponent] | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let client: HttpClient; | |
beforeEach(() => { | |
TestBed.configureTestingModule({ | |
imports: [ | |
HttpClientTestingModule | |
], | |
providers: [{ | |
provide: HTTP_INTERCEPTORS, | |
useClass: GitHubApiVersionInterceptor, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('placement="left"', () => { | |
let windowEl; | |
beforeEach(() => { | |
const fixture = createTestComponent(`<div ngbTooltip="Great tip!" placement="left"></div>`); | |
const directive = fixture.debugElement.query(By.directive(NgbTooltip)); | |
triggerEvent(directive, 'mouseenter'); | |
fixture.detectChanges(); | |
windowEl = getWindow(fixture.nativeElement); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('placement="left"', () => { | |
let windowEl; | |
beforeEach(() => { | |
const fixture = createTestComponent(`<div ngbTooltip="!" placement="left"></div>`); | |
const directive = fixture.debugElement.query(By.directive(NgbTooltip)); | |
triggerEvent(directive, 'mouseenter'); | |
fixture.detectChanges(); | |
windowEl = getWindow(fixture.nativeElement); | |
}); |
NewerOlder