name: Multisite Search > Pagefind UI skips an optional index that fails to load steps: - ref: ./background.toolproof.yml - step: I have a "root/index.html" file with the content {html} html: |- - macro: I run Pagefind with "--site root/website_a" - step: stdout should contain "Running Pagefind" - step: The file "root/website_a/pagefind/pagefind.js" should not be empty - macro: I run Pagefind with "--site root/website_b" - step: stdout should contain "Running Pagefind" - step: The file "root/website_b/pagefind/pagefind.js" should not be empty - step: I serve the directory "root" - step: In my browser, I load "/" - step: In my browser, I evaluate {js} js: |- let pui = new PagefindUI({ element: "#search", mergeIndex: [{ bundlePath: "/website_c/pagefind/", optional: true }, { bundlePath: "/website_b/pagefind/" }] }); pui.triggerSearch("web"); - step: In my browser, I evaluate {js} js: >- let val = await toolproof.querySelector(".pagefind-ui__result:nth-of-type(1) .pagefind-ui__result-link"); toolproof.assert_eq(val.innerHTML, `web web world web PAGEFIND_ROOT_SELECTOR`); - step: In my browser, I evaluate {js} js: >- let val = await toolproof.querySelector(".pagefind-ui__result:nth-of-type(2) .pagefind-ui__result-link"); toolproof.assert_eq(val.innerHTML, `web ipsum`);