Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

babel-plugin-redwood-routes-auto-loader.tests.ts: Break up into separate tests #7858

Conversation

Tobbe
Copy link
Member

@Tobbe Tobbe commented Mar 18, 2023

Refactor tests
Wrap tests in a describe, and break the one test with multiple assertions up into separate tests.

@Tobbe Tobbe added the release:chore This PR is a chore (means nothing for users) label Mar 18, 2023

beforeAll(() => {
process.env.RWJS_CWD = FIXTURE_PATH
result = transform(getPaths().web.routes)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jtoar This was key. We left it outside beforeAll, so it tried to run getPaths() before RWJS_CWD was defined

@replay-io
Copy link

replay-io bot commented Mar 18, 2023

16 replays were recorded for 428bb48.

image 0 Failed
image 16 Passed
    requireAuth graphql checks
          ```
          locator.waitFor: Target closed
          =========================== logs ===========================
          waiting for locator('.rw-form-error-title').locator('text=You don\'t have permission to do that') to be visible
          ============================================================
          ```
        </ol>
      </details>
      <li><a href=https://app.replay.io/recording/c5413376-9836-4729-85d8-a6b436f341d7>useAuth hook, auth redirects checks</a></li>
      <li><a href=https://app.replay.io/recording/321fb132-350d-48cc-8f97-4b0172c62f17>Check that a specific blog post is prerendered</a></li>
      <li><a href=https://app.replay.io/recording/d141a875-5406-4ac7-a68d-f03154cb46a8>Check that about is prerendered</a></li>
      <li><a href=https://app.replay.io/recording/46583396-c407-4245-a3e2-91bc1f94cb8f>Check that homepage is prerendered</a></li>
      <li><a href=https://app.replay.io/recording/ba01af6c-b907-427b-8137-d8b81fcd379d>Check that meta-tags are rendering the correct dynamic data</a></li>
      <li><a href=https://app.replay.io/recording/4aec3c9f-70f0-499f-a11c-8c4048ac7416>Check that you can navigate from home page to specific blog post</a></li>
      <li><a href=https://app.replay.io/recording/75ac8207-d3a7-475b-8bdd-09e1431212ed>Waterfall prerendering (nested cells)</a></li>
      <li><a href=https://app.replay.io/recording/779f31d2-7065-4c2c-965f-cc7093242c44>RBAC: Admin user should be able to delete contacts</a></li>
      <li><a href=https://app.replay.io/recording/b3aa79bc-2e68-4aad-8a28-a1f9273cc42e>RBAC: Should not be able to delete contact as non-admin user</a></li>
      <li><a href=https://app.replay.io/recording/2781bce5-68dd-45a6-91a0-0905ed907bd5>Smoke test with dev server</a></li>
      <li><a href=https://app.replay.io/recording/9804be0d-bbea-4ec5-863d-fef8169577df>Smoke test with rw serve</a></li>
      <li><a href=https://app.replay.io/recording/fc6bfac3-5488-4b91-8b38-8b9665790af8>Loads Cell mocks when Cell is nested in another story</a></li>
      <li><a href=https://app.replay.io/recording/e5e08a46-ee3e-4b0c-a382-f35afbc1822e>Loads Cell Stories</a></li>
      <li><a href=https://app.replay.io/recording/f7304c38-f55c-41c0-8919-59ef49e70ac9>Loads MDX Stories</a></li>
      <li><a href=https://app.replay.io/recording/a792d503-f4db-4453-acc7-ad82a73725b6>Mocks current user, and updates UI while dev server is running</a></li>
      

View test run on Replay ↗︎

@Tobbe Tobbe enabled auto-merge (squash) March 18, 2023 01:24
@Tobbe Tobbe added release:chore This PR is a chore (means nothing for users) and removed release:chore This PR is a chore (means nothing for users) labels Mar 18, 2023
@Tobbe Tobbe merged commit 99eab5c into redwoodjs:main Mar 18, 2023
@redwoodjs-bot redwoodjs-bot bot added this to the next-release milestone Mar 18, 2023
@Tobbe Tobbe deleted the tobbe-babel-plugin-redwood-routes-auto-loader-test-describe branch March 18, 2023 06:16
jtoar pushed a commit that referenced this pull request Mar 23, 2023
@thedavidprice thedavidprice modified the milestones: next-release, v4.4.0 Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:chore This PR is a chore (means nothing for users)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants