-
Notifications
You must be signed in to change notification settings - Fork 36
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
DOP-4835: Fix meta robots not appearing due to missing page data #1169
Conversation
let mockPageContext = mockHeadPageContext; | ||
it('renders the canonical tag from directive rather than pulling from snooty.toml', () => { | ||
mockPageContext = mockCompleteEOLPageContext; | ||
mockPageContext.page.children.push(metaCanonical); | ||
render(<Head pageContext={mockPageContext} />); | ||
const mockPageContext = { ...mockHeadPageContext.pageContext }; | ||
const mockData = { ...mockCompleteEOLPageContext.data }; | ||
mockData.page.ast.children.push(metaCanonical); |
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.
Spreading the data instead of reusing local variable due to potential data leaking in between tests due to object modifications for the last 2 unit tests below. Spreading here will help keep copies of data separate to promote independent tests
Realized that we can throw the error instead of just printing it out, so I changed that in the code. Might be more appropriate given the importance of having the AST in this component at the moment |
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.
LGTM
Good call, I was just about to ask about that, and if we could cause the build to fail since it seem important to have. |
Stories/Links:
DOP-4835
Current Behavior:
Atlas prod -
noindex
does not appear in a meta tagStaging Links:
Atlas staging -
noindex
appears in a meta tag.Notes:
Head
component to split between page context and data. This should better mock how data is being passed into the component.README updates