mirror of
https://github.com/withastro/astro.git
synced 2025-01-06 22:10:10 -05:00
f40065f510
* Ensure index pages are generated on paginated results * Changeset
27 lines
719 B
JavaScript
27 lines
719 B
JavaScript
import { expect } from 'chai';
|
|
import * as cheerio from 'cheerio';
|
|
import { loadFixture } from './test-utils.js';
|
|
|
|
describe('getStaticPaths with trailingSlash: ignore', () => {
|
|
let fixture;
|
|
|
|
before(async () => {
|
|
fixture = await loadFixture({
|
|
root: './fixtures/get-static-paths-pages/',
|
|
site: 'https://mysite.dev/',
|
|
});
|
|
await fixture.build();
|
|
});
|
|
|
|
it('includes index page', async () => {
|
|
let html = await fixture.readFile('/index.html');
|
|
let $ = cheerio.load(html);
|
|
expect($('h1').text()).to.equal('Page 1');
|
|
});
|
|
|
|
it('includes paginated page', async () => {
|
|
let html = await fixture.readFile('/2/index.html');
|
|
let $ = cheerio.load(html);
|
|
expect($('h1').text()).to.equal('Page 2');
|
|
});
|
|
});
|