-
Notifications
You must be signed in to change notification settings - Fork 6
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
Increase code coverage 5 #2648
Increase code coverage 5 #2648
Conversation
458dd6f
to
c68f782
Compare
@@ -3,13 +3,10 @@ import {cnxFetch} from './table-of-contents-html'; | |||
import memoize from 'lodash/memoize'; | |||
|
|||
export function bookToc(slug: string) { | |||
if (!slug) { |
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.
Is this guaranteed to not be empty, or maybe prefer to have the throw in cmsFetch
?
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.
The only place it is called tests for slug
.
return cmsFetch(slug) | ||
.then((bi) => { | ||
const isRex = Boolean(bi.webview_rex_link); | ||
const webviewLink = isRex ? bi.webview_rex_link : bi.webview_link; | ||
const isRex = true; |
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 see that this controls which paths to use but I'm not following why it can always be true
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.
This is leftover from the transition to Rex. The non-Rex option was CNX, which no longer exists.
There's no longer a webview_link
field in the CMS. I need to go through the codebase and remove isRex
generally.
All this just to get coverage for one branch in clipped-image.tsx! (But also additional code in TSX with coverage, plus a couple fixes)
c68f782
to
cfa5fcb
Compare
DISCO-431