-
Notifications
You must be signed in to change notification settings - Fork 7
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
MWPW-144683 Article Header Unit Test #44
Conversation
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
Commits
|
export function loadTaxonomy() { | ||
|
||
} | ||
|
||
export function getLinkForTopic() { | ||
return '#'; | ||
} | ||
|
||
export function getTaxonomyModule() { | ||
return 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.
To explain:
These are here as mocks for the external milo scripts, as called out as best practice by the community. Before, I've tried to use import maps like we do in milo tests, but they don't work with template strings in dynamic imports. Here, I'm mocking the external scripts by setting milo libs to pull from the localhost mocks folder.
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.
@Brandon32 Let me know if you have further questions
Not blocking, but I do wonder if this unit test doesn't belong in Milo itself? I understand we are testing the implementation that occurs in our utils.js, but wondering if we could skip some of the mocks by adding the test in milo? Or even what about the test in Milo was inadequate to catch our use case? |
I don't think that tests in milo would adequately cover our use case. The article header block in milo requires a very specific input or else it errors out and the block doesn't build correctly. That's essentially what we're testing here: Does the code in bacom blog utils provide correctly formatted data for the article header block to use? Edit: It's possible that we could avoid mocking milo libs by rewriting |
No objection to the way it's done. Just finding the test interesting, and what it necessitates interesting. "Does the code in bacom blog utils provide correctly formatted data for the article header block to use" is not something I think we've tested for in other consumer repos, and it exposes that the |
Related to: MWPW-144683
Test URLs:
N/A