Skip to content

Commit

Permalink
Cleaning up React + Apollo example
Browse files Browse the repository at this point in the history
- Simplify test
- Fix bug in makeApolloClient (pageProps was missing)
- Add comment about having to instantiate a new Apollo Client per request
- Remove _error.page.jsx
- Use static page title
- Remove unnecessary package.json scripts (and the packages for them)
  • Loading branch information
stephensamra authored and brillout committed Mar 28, 2021
1 parent 0243908 commit 12b1bdb
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 600 deletions.
2 changes: 0 additions & 2 deletions examples/react-apollo/.test-dev.spec.js

This file was deleted.

2 changes: 0 additions & 2 deletions examples/react-apollo/.test-prod.spec.js

This file was deleted.

10 changes: 10 additions & 0 deletions examples/react-apollo/.test.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const { fetchHtml, run } = require("../../tests/setup");

run("npm run start");

test("page content is rendered to HTML", async () => {
const html = await fetchHtml("/");
expect(html).toContain("<h1>Welcome to <code>vite-plugin-ssr</code></h1>");
expect(html).toContain("<li>Angola</li><li>Antarctica</li><li>Argentina</li><li>American Samoa</li>");
expect(html).toContain("pageProps: (function(a){return {initialApolloState:{ROOT_QUERY:");
});
Loading

0 comments on commit 12b1bdb

Please sign in to comment.