-
Notifications
You must be signed in to change notification settings - Fork 479
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
[Sprite Lab] Test for workspace alert #45099
Conversation
@@ -40,11 +41,11 @@ describe('SpriteLab', () => { | |||
}); | |||
afterEach(() => document.body.removeChild(container)); | |||
|
|||
let studioApp; | |||
let testStudioApp; |
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.
naming nit: in unit tests a "fake" version of something usually called a "mock"; this object is a mock version of StudioApp, so the convention would be mockStudioApp
(which also means your rename here is how it originally should've been named!)
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.
there are multiple ways to fake things in unit tests, too, as you've shown in your changes here. this is a good article about the difference between the two most common fakes, mocks and stubs: https://martinfowler.com/articles/mocksArentStubs.html
workspaceAlertError: () => { | ||
return 'translated string'; | ||
} |
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.
we can simplify this expression with ES6 arrow function expressions
This is a follow-up to #45055, which adds a workspace alert for execution errors in Sprite Lab. We should also add a test to be sure this is working as intended.
Due to a naming conflict, we can rename an existing use of
studioApp
and reserve that label for the singleton that is imported. (See new line 23 and changes to lines ~43 to ~65).Created Jira ticket STAR-2127 as a subtask of STAR-2099 to track.