0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-06 22:10:10 -05:00
astro/packages/astro/test/get-static-paths-pages.test.js
Matthew Phillips f40065f510
Ensure index pages are generated on paginated results (#4426)
* Ensure index pages are generated on paginated results

* Changeset
2022-08-23 08:47:20 -04:00

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');
});
});