-
Notifications
You must be signed in to change notification settings - Fork 113
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
Chore: Add util tests and fix file tests #702
Conversation
- Contact Us redirect to Box support page should only show up in the Box web application - Fix non-wrapping error text in IE11 - Consolidate download checks into util function - Move file-specific util method into file.js
Add Babel Rewire plugin so we can properly test `inBoxWebApp()` and fix `canDownload()` tests
Verified that @tonyjin has signed the CLA. Thanks for the pull request! |
[false, true, false, false, false], | ||
[true, false, false, false, false], | ||
[true, true, true, true, true], | ||
].forEach(([isDownloadable, isDownloadEnabled, havePermission, isBrowserSupported, expectedResult]) => { |
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.
I didn't have the [] here before wrapping the arguments at first, but the test still passed since an array for the first param and undefined for all of the others still passed the test...
*/ | ||
export function getHostname() { | ||
return window.location.hostname || ''; | ||
} |
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.
Now hostname is stub-able for tests
Huh, looks like Rewire may be causing a bunch of other issues with our tests... Will re-visit after #696 is merged. |
Closing in favor of #709 Babel rewire was causing issues with a lot of other tests. Essentially any other test that stubbed out something imported from file, util, or any other function that exported functions needed to be rewritten with Babel rewire. |
Add Babel Rewire plugin so we can properly test
inBoxWebApp()
and fixcanDownload()
testsDepends on #696