-
Notifications
You must be signed in to change notification settings - Fork 4k
sb-file-uploader gets title of any sb.* file; calls onUpdateProjectTitle #3379
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
sb-file-uploader gets title of any sb.* file; calls onUpdateProjectTitle #3379
Conversation
|
@rschamp any suggestions for how to write tests for this? Seems like it's tricky to do it without opening the OS filepicker... |
rschamp
left a comment
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 think the best way to test these changes specifically would be to add unit tests for the HOC and break up the methods a bit so you could test the matcher in isolation from everything else.
Supposedly you can use sendKeys to have selenium interact with a file input: https://stackoverflow.com/questions/13963738/how-does-selenium-webdriver-upload-files-to-the-browser
… title from .sb2 and .sb3 filenames
651d635 to
76e11e0
Compare
|
Take a look. I didn't mock up the filepicker input, just made unit tests of the filename extraction. It's a start! |
rschamp
left a comment
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.
Excellent!
Resolves
Resolves #3339 and #3140 and #3357
Proposed Changes
Handles/shows title of a 2.0 project (and will work for 1.0 projects, and projects missing extension, if it needs to) when one is loaded in 3.0.
calls the onUpdateProjectTitle passed to it from
MenuBarwith the new title, if it exists. This allows code that encloses or embeds GUI to be notified of the title change when a file is uploaded.Reason for Changes
Test Coverage
None. Unclear how to test this well?
Browser Coverage
tested in Mac Chrome