我正在测试属性指令。该指令的大多数功能都可以在小屏幕尺寸上进行测试。在执行每个测试用例之前,如何提供窗口对象并将其调整为特定的宽度和高度?
beforeEach(() => {
fixture = TestBed.configureTestingModule({
declarations: [ TestComponent, NavDirective]
})
.createComponent(TestComponent);
fixture.detectChanges();
});
it('should open when trigger button is clicked', () => {
//write tests to simulate a click on the trigger button
//but it is visible only when the screen size is small
});