-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore: Add util tests and fix file tests (#709)
- Move hostname check to Browser function so we can test `isBoxWebApp()` - Fix incorrect `file.canDownload()` tests, they were missing brackets - Add missing peer dependency - Clean up package.json and run `yarn upgrade`
- Loading branch information
Showing
8 changed files
with
1,692 additions
and
1,083 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
class Location { | ||
/** | ||
* Returns window hostname to simplify testing. | ||
* | ||
* @return {string} Window hostname | ||
*/ | ||
static getHostname() { | ||
return window.location.hostname || ''; | ||
} | ||
|
||
/** | ||
* Returns window origin to simplify testing. | ||
* | ||
* @return {string} Window location | ||
*/ | ||
static getOrigin() { | ||
return window.location.origin || ''; | ||
} | ||
} | ||
|
||
export default Location; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.