docsify/test/e2e/index-file.test.js
John Hildenbiddle f5412dc7b0
chore: Update lint configuration (ESLint 9, Prettier 3) (#2438)
* Update linting configuration (eslint, prettier)

* Fix lint issues following eslint prettier update

* Change ESLint config to allow boolean coercion

* Switch to default import name per docs

* Fix suppression of error details

* Update JSDoc comments

* Update waiForFunctin to provide error details

---------

Co-authored-by: Koy Zhuang <koy@ko8e24.top>
2024-05-28 15:27:29 -05:00

29 lines
878 B
JavaScript

import docsifyInit from '../helpers/docsify-init.js';
import { test, expect } from './fixtures/docsify-init-fixture.js';
test.describe('Index file hosting', () => {
const sharedOptions = {
config: {
basePath: '/index.html#/',
},
testURL: '/index.html#/',
};
test('should serve from index file', async ({ page }) => {
await docsifyInit(sharedOptions);
await expect(page.locator('#main')).toContainText(
'A magical documentation site generator',
);
expect(page.url()).toMatch(/index\.html#\/$/);
});
test('should use index file links in sidebar from index file hosting', async ({
page,
}) => {
await docsifyInit(sharedOptions);
await page.click('a[href="#/quickstart"]');
await expect(page.locator('#main')).toContainText('Quick start');
expect(page.url()).toMatch(/index\.html#\/quickstart$/);
});
});