2021-03-31 20:10:27 +00:00
|
|
|
import { suite } from 'uvu';
|
|
|
|
import * as assert from 'uvu/assert';
|
|
|
|
import { doc } from './test-utils.js';
|
|
|
|
import { setup } from './helpers.js';
|
|
|
|
|
|
|
|
const Fallback = suite('Dynamic component fallback');
|
|
|
|
|
|
|
|
setup(Fallback, './fixtures/astro-fallback');
|
|
|
|
|
|
|
|
Fallback('Shows static content', async (context) => {
|
|
|
|
const result = await context.runtime.load('/');
|
2021-05-12 18:06:16 +00:00
|
|
|
if (result.error) throw new Error(result.error);
|
2021-03-31 20:10:27 +00:00
|
|
|
|
|
|
|
const $ = doc(result.contents);
|
|
|
|
assert.equal($('#fallback').text(), 'static');
|
|
|
|
});
|
|
|
|
|
|
|
|
Fallback.run();
|