-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
routing tests #1249 #1466
Conversation
There was a problem hiding this 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.
I fixed the errors that were occurring with the tests and hid the warnings that had to do with linking the MUI styles! |
There was a problem hiding this 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.
I ran an npm i
and checked the package.json and didn't see the 'canvas' dependency it's looking for.
@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 |
There was a problem hiding this 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 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? |
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. |
There was a problem hiding this 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 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: |
hey @sydneywalcoff @whitneywind for this error: you can resolve by updating customMuiTheme.ts from this: looks like that's already the case on |
There was a problem hiding this comment.
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
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 |
Superseded by #1584 |
For issue #1249