Skip to content

Commit bf6eeb0

Browse files
committed
test(pena-utils): add test for params 'needScrollTo'
1 parent af62836 commit bf6eeb0

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

packages/pena-utils/src/url.spec.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,24 @@ describe('createURL', () => {
8282
expect(url.href).toBe('http://sign.document.com/123456?debug=true')
8383
})
8484

85+
it('should able to set user to scroll to spesific page using `needScrollTo`', () => {
86+
const url = createURL({
87+
url : 'http://sign.document.com/123456',
88+
needScrollTo: 5,
89+
})
90+
91+
expect(url.href).toBe('http://sign.document.com/123456?need_scrollto=5')
92+
})
93+
94+
it('should able to set user to scroll to last page using `needScrollTo` set to `last`', () => {
95+
const url = createURL({
96+
url : 'http://sign.document.com/123456',
97+
needScrollTo: 'last',
98+
})
99+
100+
expect(url.href).toBe('http://sign.document.com/123456?need_scrollto=last')
101+
})
102+
85103
it('should able to set invisible signature with `visibility` set to false', () => {
86104
const url = createURL({
87105
url : 'http://sign.document.com/123456',

0 commit comments

Comments
 (0)