-
Notifications
You must be signed in to change notification settings - Fork 0
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
app.test.tsx changes #21
Conversation
2d22e8e
to
cb923f5
Compare
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.
Tested locally and works great.
Noticed the Provider
error messages but I think we can work around those later on.
cb923f5
to
c2ab4e0
Compare
function makeDefaultProps(): jest.Mocked<LensAppProps> { | ||
return { | ||
editorFrame: createMockFrame(), | ||
let props: jest.Mocked<LensAppProps>; |
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.
One question here.
What's the benefit of having a shared variable and reset it on every test with a beforeEach
vs generating all the mocks explicitly every time?
It is just code readability (not calling it every time) or there's more?
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's way less code to read (like calling makeDefaultProps function and then modifying the properties we want and then pass it to the renderApp
) with this pattern so I think it's just nicer :)
|
||
const sessionIdSubject = new Subject<string>(); | ||
const getLensDocumentMock = (someProps?: Partial<LensDocument>) => ({ |
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.
In the original code there's a cloneDeep
function that wraps this to enable document manipulation within tests without worry about influencing other tests.
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.
reverted 👌🏼
Summary
Summarize your PR. If it involves visual changes include a screenshot or gif.
Checklist
Delete any items that are not applicable to this PR.
For maintainers