mirror of
https://github.com/docsifyjs/docsify.git
synced 2025-12-08 19:55:52 +00:00
* Adds option to specify an header height When using a template that has a sticky-header, clicking on the sidebar will scroll the page under the header. I added the option `headerHeight` (default = `0`) so that the content div will be scrolled down that amount of pixels. * updates documentation and renames variable
33 lines
770 B
JavaScript
33 lines
770 B
JavaScript
/* eslint-disable no-global-assign */
|
|
require = require('esm')(
|
|
module /* , options */
|
|
); /* eslint-disable-line no-global-assign */
|
|
const { expect } = require('chai');
|
|
const { resolvePath } = require('../../src/core/router/util');
|
|
|
|
describe('router/util', function() {
|
|
it('resolvePath', async function() {
|
|
// WHEN
|
|
const result = resolvePath('hello.md');
|
|
|
|
// THEN
|
|
expect(result).equal('/hello.md');
|
|
});
|
|
|
|
it('resolvePath with dot', async function() {
|
|
// WHEN
|
|
const result = resolvePath('./hello.md');
|
|
|
|
// THEN
|
|
expect(result).equal('/hello.md');
|
|
});
|
|
|
|
it('resolvePath with two dots', async function() {
|
|
// WHEN
|
|
const result = resolvePath('test/../hello.md');
|
|
|
|
// THEN
|
|
expect(result).equal('/hello.md');
|
|
});
|
|
});
|