Repository navigation
Test the citation fetch's whole run - #137
Merged
Merged
Conversation
- CitationFetch.run holds what the script's main block did (fetch, the
keyless retry, the fallback, the stale check, the write), so it is
unit-tested; the main block only reads the posts and calls it.
- note moves into CitationFetch instead of a top-level method.
- A test holds the layout's and js/citations.js's wording of the count
("N citations on Semantic Scholar", title, link) to each other.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This picks up the minor review findings that were deferred after #135 and #136.
CitationFetch.run: the script's main block is now a function, and these tests cover it (6 cases):The main block now only reads the posts and calls
run.notemoved intoCitationFetch, so requiring the script in tests no longer defines a method onObject.A wording test keeps the count's wording in
_layouts/post.htmlandjs/citations.jsin step: the aria-label, the title and the link. A mutation check confirmed that changing the JS wording makes it fail.The behaviour is unchanged. Not done, since the gain is small for the churn: unifying the entry field names across Ruby, JSON and JS, and making a stale
citation_ids.ymlkey a warning instead of fatal (the PR gate already catches it).Verification:
validate-site.shall pass