astro/packages/astro/test/astro-fallback.test.js
2021-12-22 16:11:05 -05:00

21 lines
541 B
JavaScript

import { expect } from 'chai';
import cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';
describe('Dynamic component fallback', () => {
let fixture;
before(async () => {
fixture = await loadFixture({
projectRoot: './fixtures/astro-fallback',
renderers: ['@astrojs/renderer-preact'],
});
await fixture.build();
});
it('Shows static content', async () => {
const html = await fixture.readFile('/index.html');
const $ = cheerio.load(html);
expect($('#fallback').text()).to.equal('static');
});
});