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.
|
layershifter
left a comment
There was a problem hiding this comment.
Let's add some tests for it
| { | ||
| files: '**/*.{ts,tsx}', | ||
| rules: { | ||
| 'no-dupe-class-members': 'off', |
There was a problem hiding this comment.
Otherwise we get false positive in RendererMock.tsx, see typescript-eslint/typescript-eslint#291
There was a problem hiding this comment.
No longer needed at the moment, but I think it will be useful to keep this change, as described in the link above
@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.
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.
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.
Can we use some dumb definition instead?
Fixes #1814