mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-29 12:03:44 +03:00
Fix tests
This commit is contained in:
parent
c45df1e445
commit
0712297ba5
|
@ -55,7 +55,7 @@ export default class StickySidebar {
|
||||||
}
|
}
|
||||||
|
|
||||||
get scrollY() {
|
get scrollY() {
|
||||||
return (this.scrollParent.pageYOffset === null) ? this.scrollParent.scrollTop : this.scrollParent.pageYOffset;
|
return (this.scrollParent.pageYOffset !== null) ? this.scrollParent.pageYOffset : this.scrollParent.scrollTop;
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
|
@ -49,7 +49,9 @@ describe('Common components', () => {
|
||||||
it('should stick if scrolled more than scrollYOffset', () => {
|
it('should stick if scrolled more than scrollYOffset', () => {
|
||||||
spyOn(component, 'stick').and.callThrough();
|
spyOn(component, 'stick').and.callThrough();
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
window.pageYOffset = 40;
|
component.scrollParent = {
|
||||||
|
pageYOffset: 40
|
||||||
|
};
|
||||||
component.updatePosition();
|
component.updatePosition();
|
||||||
expect(component.stick).toHaveBeenCalled();
|
expect(component.stick).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user