This repository was archived by the owner on Jul 6, 2026. It is now read-only.
Repository navigation
Update createPage to support windows paths - #243
Merged
Merged
Conversation
oshi97
marked this pull request as ready for review
June 27, 2023 16:55
tmeyer2115
reviewed
Jun 27, 2023
tmeyer2115
left a comment
Contributor
There was a problem hiding this comment.
Did this only impact tests run on Windows? Or did this bug actually prevent Windows users from creating pages?
tmeyer2115
self-requested a review
June 27, 2023 17:28
tmeyer2115
approved these changes
Jun 27, 2023
tmeyer2115
left a comment
Contributor
There was a problem hiding this comment.
Did this only impact tests run on Windows? Or did this bug actually prevent Windows users from creating pages?
Contributor
Author
It prevented users from creating pages! Users would get an error message in the modal |
oshi97
added a commit
that referenced
this pull request
Jun 27, 2023
This is the same change as in #243 but for modules. This gets the createModule tests passing. In theory it also was preventing windows users from creating new modules (though we currently don't allow anybody to create modules anyways). With this all of the frontend jest tests are passing! J=SLAP-2790 TEST=auto
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Paths like
C:\Users\username\Documents\Github\studio-prototype\packages\studio\tests\__mocks__/test.tsxare not considered absolute bypath.isAbsolutein the frontend. This is because we are usingpath-browserify(a browser version of nodejs'spath) which does not have proper windows support. In real nodejs,path.isAbsolutewill return true for a windows path like the above.browserify/path-browserify#1
We could look for an alternative but I'm not sure if that will be necessary. I think I'll have a better picture of that when I'm further in with getting the unit tests compatibility.
For the createPage action, the path.isAbsolute check is unnecessary since we do a
filepath.startsWith(pagesPath)check as well, andpagesPathis always absolute. We may want to support a relative pagesPath at which point we may need to add additional validation, but it would probably make more sense for that validation to go into the backend.J=SLAP-2791
TEST=auto
tests for createPage.ts and AddPageButton are now passing