test
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
3774d1dd1f
commit
529bd5673c
|
@ -53,8 +53,10 @@ class Controller extends Section {
|
||||||
|
|
||||||
scrollToLine(lineFk) {
|
scrollToLine(lineFk) {
|
||||||
const hashFk = this.lineFk || lineFk;
|
const hashFk = this.lineFk || lineFk;
|
||||||
|
console.log(hashFk);
|
||||||
const hash = `vnItemDiary-${hashFk}`;
|
const hash = `vnItemDiary-${hashFk}`;
|
||||||
this.$location.hash(hash);
|
this.$location.hash(hash);
|
||||||
|
console.log(this.$location);
|
||||||
this.$anchorScroll();
|
this.$anchorScroll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,19 +44,19 @@ describe('Item', () => {
|
||||||
describe('scrollToLine ()', () => {
|
describe('scrollToLine ()', () => {
|
||||||
it('should assign $location then call anchorScroll using controller value', () => {
|
it('should assign $location then call anchorScroll using controller value', () => {
|
||||||
jest.spyOn(controller, '$anchorScroll');
|
jest.spyOn(controller, '$anchorScroll');
|
||||||
controller.ticketFk = 1;
|
controller.lineFk = 1;
|
||||||
controller.scrollToLine('invalidValue');
|
controller.scrollToLine('invalidValue');
|
||||||
|
|
||||||
expect(controller.$location).toEqual(`vnItemDiary-${1}`);
|
expect(controller.$location.hash()).toEqual(`vnItemDiary-${1}`);
|
||||||
expect(controller.$anchorScroll).toHaveBeenCalledWith();
|
expect(controller.$anchorScroll).toHaveBeenCalledWith();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should assign $location then call anchorScroll using received value', () => {
|
it('should assign $location then call anchorScroll using received value', () => {
|
||||||
jest.spyOn(controller, '$anchorScroll');
|
jest.spyOn(controller, '$anchorScroll');
|
||||||
controller.ticketFk = undefined;
|
controller.lineFk = undefined;
|
||||||
controller.scrollToLine(1);
|
controller.scrollToLine(1);
|
||||||
|
|
||||||
expect(controller.$location).toEqual(`vnItemDiary-${1}`);
|
expect(controller.$location.hash()).toEqual(`vnItemDiary-${1}`);
|
||||||
expect(controller.$anchorScroll).toHaveBeenCalledWith();
|
expect(controller.$anchorScroll).toHaveBeenCalledWith();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue