Skip to content
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

Merged
merged 8 commits into from
Jul 31, 2024
Merged

Increase code coverage 5 #2648

merged 8 commits into from
Jul 31, 2024

Conversation

RoyEJohnson
Copy link
Contributor

@RoyEJohnson RoyEJohnson commented Jul 25, 2024

@@ -3,13 +3,10 @@ import {cnxFetch} from './table-of-contents-html';
import memoize from 'lodash/memoize';

export function bookToc(slug: string) {
if (!slug) {
Copy link
Member

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?

Copy link
Contributor Author

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;
Copy link
Member

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

Copy link
Contributor Author

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.

@RoyEJohnson RoyEJohnson merged commit b07a9b6 into main Jul 31, 2024
1 check passed
@RoyEJohnson RoyEJohnson deleted the increase-code-coverage-5 branch July 31, 2024 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants