mirror of
https://github.com/Redocly/redoc.git
synced 2025-03-03 09:25:47 +03:00
chore: fix tests
This commit is contained in:
parent
8e8d9d8995
commit
5cc1208bb1
|
@ -15,7 +15,7 @@ describe('Common components', () => {
|
|||
});
|
||||
describe('StickySidebar Component', () => {
|
||||
let builder;
|
||||
let component;
|
||||
let component: StickySidebar;
|
||||
let fixture;
|
||||
|
||||
beforeEach(() => {
|
||||
|
@ -31,6 +31,7 @@ describe('Common components', () => {
|
|||
});
|
||||
|
||||
it('should start unsticked', () => {
|
||||
component.disable = true;
|
||||
spyOn(component, 'stick').and.callThrough();
|
||||
spyOn(component, 'stickBottom').and.callThrough();
|
||||
fixture.detectChanges();
|
||||
|
@ -41,7 +42,9 @@ describe('Common components', () => {
|
|||
it('should stick to the top on the next animation frame', (done) => {
|
||||
spyOn(component, 'stick').and.callThrough();
|
||||
spyOn(component, 'stickBottom').and.callThrough();
|
||||
component.disable = true;
|
||||
fixture.detectChanges();
|
||||
component.disable = false;
|
||||
requestAnimationFrame(() => {
|
||||
expect(component.stick).toHaveBeenCalled();
|
||||
expect(component.stickBottom).toHaveBeenCalled();
|
||||
|
|
|
@ -90,7 +90,7 @@ export class StickySidebar implements OnInit, OnDestroy, OnChanges {
|
|||
}
|
||||
|
||||
ngOnChanges() {
|
||||
if (this.disable) return;
|
||||
if (!this.$redocEl || this.disable) return;
|
||||
this.updatePosition();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user