flecks/packages/react/test/ssr.js
2024-02-15 04:58:13 -06:00

22 lines
534 B
JavaScript

import {expect} from 'chai';
import {withWeb} from '@flecks/headless/test/helpers/with-web';
it('does ssr', withWeb(
async ({page, response}) => {
expect(response)
.to.not.be.null;
expect(response.ok())
.to.be.true;
const output = await page.waitForSelector('.provider-test');
expect(await output?.evaluate((el) => el.textContent))
.to.equal('foobar');
},
{
beforePage: async ({page}) => {
await page.setJavaScriptEnabled(false);
},
template: 'templates/provider',
},
));