-
Notifications
You must be signed in to change notification settings - Fork 55
fix(Provider): should not use felaRenderer explicitly #1842
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1842 +/- ##
=======================================
Coverage 69.64% 69.64%
=======================================
Files 874 874
Lines 7610 7610
Branches 2215 2242 +27
=======================================
Hits 5300 5300
Misses 2302 2302
Partials 8 8
Continue to review full report at Codecov.
|
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.
Let's add some tests for it
{ | ||
files: '**/*.{ts,tsx}', | ||
rules: { | ||
'no-dupe-class-members': 'off', |
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.
Otherwise we get false positive in RendererMock.tsx
, see typescript-eslint/typescript-eslint#291
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.
No longer needed at the moment, but I think it will be useful to keep this change, as described in the link above
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.
Yep, let's keep it
@layershifter I have added tests. But I feel its a bit ugly to add |
} | ||
|
||
const renderFontCalled = jest.fn() | ||
const rendererMock = new RendererMock(renderFontCalled, jest.fn()) |
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.
https://jestjs.io/docs/en/jest-object.html#jestspyonobject-methodname
Have you tried spyOn
instead?
const theme: ThemeInput = { | ||
fontFaces: teams.fontFaces, | ||
} | ||
const renderer = createRenderer() |
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 cannot use felaRenderer
, because the test would pass even without this fix.
describe('calls provided renderer', () => { | ||
test('calls renderFont', () => { | ||
const theme: ThemeInput = { | ||
fontFaces: teams.fontFaces, |
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.
Can we use some dumb definition instead?
Fixes #1814