()
| 159 | } |
| 160 | |
| 161 | render() { |
| 162 | const query = this.todosQuery() |
| 163 | const mutation = this.createTodoMutation() |
| 164 | const todos = query.data?.items ?? [] |
| 165 | |
| 166 | return html` |
| 167 | <main> |
| 168 | <h1>TanStack Lit Query E2E Demo</h1> |
| 169 | <p>Verifies integration between Lit, query-core, and this adapter.</p> |
| 170 | |
| 171 | <section> |
| 172 | <div data-testid="query-status">query: ${query.status}</div> |
| 173 | <div data-testid="mutation-status">mutation: ${mutation.status}</div> |
| 174 | <div data-testid="active-fetches">fetches: ${this.isFetching()}</div> |
| 175 | <div data-testid="active-mutations"> |
| 176 | mutations: ${this.isMutating()} |
| 177 | </div> |
| 178 | <div data-testid="request-count"> |
| 179 | server-requests: ${query.data?.requestCount ?? 0} |
| 180 | </div> |
| 181 | <div data-testid="data-source"> |
| 182 | source: ${query.data?.source ?? 'none'} |
| 183 | </div> |
| 184 | </section> |
| 185 | |
| 186 | <section> |
| 187 | <button |
| 188 | data-testid="refetch" |
| 189 | @click=${() => this.todosQuery.refetch()} |
| 190 | > |
| 191 | Refetch |
| 192 | </button> |
| 193 | <button |
| 194 | data-testid="invalidate" |
| 195 | @click=${() => this.invalidateTodos()} |
| 196 | > |
| 197 | Invalidate |
| 198 | </button> |
| 199 | <button |
| 200 | data-testid="seed-cache" |
| 201 | @click=${() => this.seedCacheOnlyTodo()} |
| 202 | > |
| 203 | Seed Cache |
| 204 | </button> |
| 205 | <button |
| 206 | data-testid="reset-demo-state" |
| 207 | @click=${() => this.resetDemoState()} |
| 208 | > |
| 209 | Reset Demo State |
| 210 | </button> |
| 211 | <button |
| 212 | data-testid="fail-next-fetch" |
| 213 | @click=${() => this.forceNextFetchFailure()} |
| 214 | > |
| 215 | Fail Next Fetch |
| 216 | </button> |
| 217 | <button |
| 218 | data-testid="fail-next-mutation" |
nothing calls this directly
no test coverage detected