How an agent verifies a webpage it can never look at A developer detailed a testing approach for coding agents working with Web Components in the @relax.js/core library, introducing mount() and flush() helpers from @relax.js/core/testing to handle lifecycle timing issues that cause assertions to fail on unattached or unhydrated elements. The writeup also describes fakeServer(), which intercepts the library's HTTP module to return canned responses and record every request, letting tests verify both rendered output and network calls without stubbing fetch globally. Fifth in a series on using @relax.js/core https://www.npmjs.com/package/@relax.js/core with a coding agent. The previous piece was about seeing errors in a test. This one is about getting the component into a state where there is something to see. Everything here is from @relax.js/core/testing . An agent that knows Web Components will write this and be puzzled: js const page = document.createElement 'profile-page' ; expect page.querySelector 'form' .not.toBeNull ; // null connectedCallback only runs when the element is in a document. Created and never attached, it is inert, for reasons that have nothing to do with the component. And once attached, anything it await s finishes a task later, so asserting right after attaching sees the element before its data arrived. Two helpers cover this. mount attaches to document.body and hands back unmount , which is also how you test disconnectedCallback : js it 'stops listening once removed from the page', = { const { element, unmount } = mount 'profile-header' ; unmount ; document.dispatchEvent new ProfileSavedEvent '42', 'Alice B' ; expect element.querySelector '.display-name' ?.textContent .toBe '' ; } ; flush waits for pending microtasks and the next macrotask, so work started by a lifecycle callback has landed. You will see it after every user action in the page tests below. The page loads its data through @relax.js/core/http . fakeServer replaces the network underneath that module with canned responses and records every request: js beforeEach = { configure { baseUrl: '/api' } ; server = fakeServer .on 'GET', '/api/users/42', alice ; routing = mountRouting routes ; captured = captureRelaxErrors ; } ; afterEach = { captured.restore ; routing.unmount ; server.restore ; } ; Paths include the configured base URL and exclude the query string, because that is what a server sees. A request nothing was registered for gets a 404 whose body lists what is registered, and it is recorded like any other, so an unexpected call shows up in server.requests instead of hanging or reaching the network. The seam is deliberate. Do not stub fetch globally, and do not mock the component's own load method. The component under test is the real one, and the assertion covers both what it rendered and what it asked for: js it 'fills the form from the server when navigated to', async = { const page = await routing.navigate