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

routing tests #1249 #1466

Closed
wants to merge 7 commits into from
Closed

routing tests #1249 #1466

wants to merge 7 commits into from

Conversation

whitneywind
Copy link
Member

For issue #1249

  • These tests check that the routing works correctly as a user navigates through both the pre-form and form pages.
  • The tests fill manually navigate from page to page checking that the url and the next page's contents are correct

@whitneywind whitneywind added the ready for dev lead task ready for dev lead to evaluate label Jun 26, 2024
Copy link
Member

@sydneywalcoff sydneywalcoff left a comment

Choose a reason for hiding this comment

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

Hey @whitneywind! I sent you a message on slack, but I'm seeing a lot of warnings and errors when I run the tests.

@sydneywalcoff sydneywalcoff removed the ready for dev lead task ready for dev lead to evaluate label Jul 6, 2024
@sydneywalcoff sydneywalcoff self-requested a review July 8, 2024 21:06
@sydneywalcoff sydneywalcoff added ready for dev lead task ready for dev lead to evaluate and removed ready for dev lead task ready for dev lead to evaluate labels Jul 8, 2024
@whitneywind
Copy link
Member Author

I fixed the errors that were occurring with the tests and hid the warnings that had to do with linking the MUI styles!

@whitneywind whitneywind added the ready for dev lead task ready for dev lead to evaluate label Jul 15, 2024
Copy link
Member

@sydneywalcoff sydneywalcoff left a comment

Choose a reason for hiding this comment

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

hey @whitneywind ! The error from before is gone and all the warnings are hidden! Great job on that!

I'm getting a new error however. I'm attaching a screenshot (of most of the error) below.
Screenshot 2024-07-15 at 7 30 09 PM

I ran an npm i and checked the package.json and didn't see the 'canvas' dependency it's looking for.

@whitneywind
Copy link
Member Author

@sydneywalcoff I removed a setup file that mentioned canvas and the tests are working without any errors on my end! Please let me know if you're still getting that error

Copy link
Member

@sydneywalcoff sydneywalcoff left a comment

Choose a reason for hiding this comment

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

@whitneywind I'm still getting that same error :( I'll message you on slack

@sydneywalcoff sydneywalcoff removed the ready for dev lead task ready for dev lead to evaluate label Jul 26, 2024
@whitneywind
Copy link
Member Author

@sydneywalcoff It's working for me without errors with node versions 16 and 18. I did have to reinstall the packages for the version 16 when I tested it with that. Is it working for you? And is there a specific node version that it should be used with?

@whitneywind whitneywind added the ready for dev lead task ready for dev lead to evaluate label Aug 6, 2024
@sydneywalcoff
Copy link
Member

hey @whitneywind,

Can you create a new branch off of dev and copy over your changes? It'll be the easiest way to resolve the merge conflict.
You'll need to open a new PR when you do.

@sydneywalcoff sydneywalcoff removed the ready for dev lead task ready for dev lead to evaluate label Sep 6, 2024
@whitneywind whitneywind added the ready for dev lead task ready for dev lead to evaluate label Sep 10, 2024
Copy link
Member

@sydneywalcoff sydneywalcoff left a comment

Choose a reason for hiding this comment

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

@whitneywind I'm still getting the below error when I run it, but your tests are still passing.

I have a feeling that this might be unrelated, maybe from the update in packages or using node 20? It looks like this error is only coming up because your test interacts with the finalize page where you can download the letter. (and remove the 'canvas' package we installed trying to solve this)

Can you confirm that these are unrelated and then we can get this merged? This is looking great!

 console.error
      Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package)
          at module.exports (/Users/sydneywalcoff/Desktop/coding/projects/hackforla/expunge-assist/products/statement-generator/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17)
          at HTMLCanvasElementImpl.getContext (/Users/sydneywalcoff/Desktop/coding/projects/hackforla/expunge-assist/products/statement-generator/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5)
          at HTMLCanvasElement.getContext (/Users/sydneywalcoff/Desktop/coding/projects/hackforla/expunge-assist/products/statement-generator/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:131:58)
          at getContext (/Users/sydneywalcoff/Desktop/coding/projects/hackforla/expunge-assist/products/statement-generator/node_modules/jspdf/src/libs/png.js:479:36)
          at hasBrowserCanvas (/Users/sydneywalcoff/Desktop/coding/projects/hackforla/expunge-assist/products/statement-generator/node_modules/jspdf/src/libs/png.js:488:3)
          at Object.<anonymous> (/Users/sydneywalcoff/Desktop/coding/projects/hackforla/expunge-assist/products/statement-generator/node_modules/jspdf/src/libs/png.js:28:11)
          at Runtime._execModule (/Users/sydneywalcoff/Desktop/coding/projects/hackforla/expunge-assist/products/statement-generator/node_modules/react-scripts/node_modules/jest-runtime/build/index.js:1646:24)
          at Runtime._loadModule (/Users/sydneywalcoff/Desktop/coding/projects/hackforla/expunge-assist/products/statement-generator/node_modules/react-scripts/node_modules/jest-runtime/build/index.js:1185:12)
          at Runtime.requireModule (/Users/sydneywalcoff/Desktop/coding/projects/hackforla/expunge-assist/products/statement-generator/node_modules/react-scripts/node_modules/jest-runtime/build/index.js:1009:12)
          at Runtime.requireModuleOrMock (/Users/sydneywalcoff/Desktop/coding/projects/hackforla/expunge-assist/products/statement-generator/node_modules/react-scripts/node_modules/jest-runtime/build/index.js:1210:21)
          at Object.require (/Users/sydneywalcoff/Desktop/coding/projects/hackforla/expunge-assist/products/statement-generator/src/pages-form/Download.tsx:5:1)
          at Runtime._execModule (/Users/sydneywalcoff/Desktop/coding/projects/hackforla/expunge-assist/products/statement-generator/node_modules/react-scripts/node_modules/jest-runtime/build/index.js:1646:24)
          at Runtime._loadModule (/Users/sydneywalcoff/Desktop/coding/projects/hackforla/expunge-assist/products/statement-generator/node_modules/react-scripts/node_modules/jest-runtime/build/index.js:1185:12)
          at Runtime.requireModule (/Users/sydneywalcoff/Desktop/coding/projects/hackforla/expunge-assist/products/statement-generator/node_modules/react-scripts/node_modules/jest-runtime/build/index.js:1009:12)
          at Runtime.requireModuleOrMock (/Users/sydneywalcoff/Desktop/coding/projects/hackforla/expunge-assist/products/statement-generator/node_modules/react-scripts/node_modules/jest-runtime/build/index.js:1210:21)
          at Object.require (/Users/sydneywalcoff/Desktop/coding/projects/hackforla/expunge-assist/products/statement-generator/src/pages-form/FinalizePreview.tsx:15:1)
          at Runtime._execModule (/Users/sydneywalcoff/Desktop/coding/projects/hackforla/expunge-assist/products/statement-generator/node_modules/react-scripts/node_modules/jest-runtime/build/index.js:1646:24)
          at Runtime._loadModule (/Users/sydneywalcoff/Desktop/coding/projects/hackforla/expunge-assist/products/statement-generator/node_modules/react-scripts/node_modules/jest-runtime/build/index.js:1185:12)
          at Runtime.requireModule (/Users/sydneywalcoff/Desktop/coding/projects/hackforla/expunge-assist/products/statement-generator/node_modules/react-scripts/node_modules/jest-runtime/build/index.js:1009:12)
          at Runtime.requireModuleOrMock (/Users/sydneywalcoff/Desktop/coding/projects/hackforla/expunge-assist/products/statement-generator/node_modules/react-scripts/node_modules/jest-runtime/build/index.js:1210:21)
          at Object.require (/Users/sydneywalcoff/Desktop/coding/projects/hackforla/expunge-assist/products/statement-generator/src/App.tsx:34:1)
          at Runtime._execModule (/Users/sydneywalcoff/Desktop/coding/projects/hackforla/expunge-assist/products/statement-generator/node_modules/react-scripts/node_modules/jest-runtime/build/index.js:1646:24)
          at Runtime._loadModule (/Users/sydneywalcoff/Desktop/coding/projects/hackforla/expunge-assist/products/statement-generator/node_modules/react-scripts/node_modules/jest-runtime/build/index.js:1185:12)
          at Runtime.requireModule (/Users/sydneywalcoff/Desktop/coding/projects/hackforla/expunge-assist/products/statement-generator/node_modules/react-scripts/node_modules/jest-runtime/build/index.js:1009:12)
          at Runtime.requireModuleOrMock (/Users/sydneywalcoff/Desktop/coding/projects/hackforla/expunge-assist/products/statement-generator/node_modules/react-scripts/node_modules/jest-runtime/build/index.js:1210:21)
          at Object.require (/Users/sydneywalcoff/Desktop/coding/projects/hackforla/expunge-assist/products/statement-generator/src/tests/routing.test.tsx:5:1)
          at Runtime._execModule (/Users/sydneywalcoff/Desktop/coding/projects/hackforla/expunge-assist/products/statement-generator/node_modules/react-scripts/node_modules/jest-runtime/build/index.js:1646:24)
          at Runtime._loadModule (/Users/sydneywalcoff/Desktop/coding/projects/hackforla/expunge-assist/products/statement-generator/node_modules/react-scripts/node_modules/jest-runtime/build/index.js:1185:12)
          at Runtime.requireModule (/Users/sydneywalcoff/Desktop/coding/projects/hackforla/expunge-assist/products/statement-generator/node_modules/react-scripts/node_modules/jest-runtime/build/index.js:1009:12)
          at jestAdapter (/Users/sydneywalcoff/Desktop/coding/projects/hackforla/expunge-assist/products/statement-generator/node_modules/react-scripts/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:13)
          at processTicksAndRejections (node:internal/process/task_queues:95:5)
          at runTestInternal (/Users/sydneywalcoff/Desktop/coding/projects/hackforla/expunge-assist/products/statement-generator/node_modules/react-scripts/node_modules/jest-runner/build/runTest.js:389:16)
          at runTest (/Users/sydneywalcoff/Desktop/coding/projects/hackforla/expunge-assist/products/statement-generator/node_modules/react-scripts/node_modules/jest-runner/build/runTest.js:475:34)
          at Object.worker (/Users/sydneywalcoff/Desktop/coding/projects/hackforla/expunge-assist/products/statement-generator/node_modules/react-scripts/node_modules/jest-runner/build/testWorker.js:133:12) undefined

      3 | import { saveAs } from 'file-saver';
      4 | import { Document, Packer, Paragraph } from 'docx';
    > 5 | import jsPDF from 'jspdf';
        | ^
      6 | import { makeStyles, createStyles } from '@material-ui/core';
      7 | import EmailIcon from '@material-ui/icons/Email';
      8 | import GetAppIcon from '@material-ui/icons/GetApp';

      at VirtualConsole.<anonymous> (node_modules/jsdom/lib/jsdom/virtual-console.js:29:45)
      at module.exports (node_modules/jsdom/lib/jsdom/browser/not-implemented.js:12:26)
      at HTMLCanvasElementImpl.getContext (node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5)
      at HTMLCanvasElement.getContext (node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:131:58)
      at getContext (node_modules/jspdf/src/libs/png.js:479:36)
      at hasBrowserCanvas (node_modules/jspdf/src/libs/png.js:488:3)
      at Object.<anonymous> (node_modules/jspdf/src/libs/png.js:28:11)
      at Object.require (src/pages-form/Download.tsx:5:1)
      at Object.require (src/pages-form/FinalizePreview.tsx:15:1)
      at Object.require (src/App.tsx:34:1)
      at Object.require (src/tests/routing.test.tsx:5:1)

@sydneywalcoff sydneywalcoff removed the ready for dev lead task ready for dev lead to evaluate label Sep 11, 2024
@whitneywind
Copy link
Member Author

@sydneywalcoff Hmm I wonder why I'm not getting that error on my end. The tests aren't throwing any errors, but for some reason now when I do npm run lint:fix it's giving this error:
Screenshot 2024-09-12 at 10 05 44 AM

@eburdekin
Copy link
Member

hey @sydneywalcoff @whitneywind for this error:

Screenshot 2024-09-23 at 7 01 43 PM

you can resolve by updating customMuiTheme.ts from this:
Screen Shot 2024-09-29 at 5 03 47 PM
to this:
Screen Shot 2024-09-29 at 5 03 28 PM

looks like that's already the case on dev? so I'll note on #1546

@eburdekin eburdekin mentioned this pull request Sep 30, 2024
16 tasks
Copy link
Member

Choose a reason for hiding this comment

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

@sydneywalcoff @whitneywind this is the change that's causing the Material UI error

@whitneywind
Copy link
Member Author

Hi @eburdekin @sydneywalcoff If you try running the tests the error warning says that they renamed it from createMuiTheme to createTheme which is why I updated it

Screenshot 2024-09-30 at 9 38 18 AM

@sydneywalcoff
Copy link
Member

sydneywalcoff commented Sep 30, 2024

Superseded by #1584

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants