Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: refactor metadata tests to test multi matches easier (#46746)
Use some utils to match multiple dom nodes together #### Match multiple props for single DOM node ```tsx const matchDom = createDomMatcher(browser) await matchDom('meta', 'name="description"', { content: 'description' }) ``` #### Match multiple same pattern DOM nodes in html ```tsx const $ = await next.render$('html') const matchHtml = createHtmlMatcher($) await matchHtml('meta', 'name', 'property', { description: 'description', og: 'og:description' }) ``` #### Match same pattern DOM nodes in browser after hydration ```tsx const matchMultiDom = createMultiDomMatcher(browser) await matchMultiDom('meta', 'property', 'content', { description: 'description', 'og:title': 'title', 'twitter:title': 'title' }) ```
- Loading branch information