(code: string)
| 300 | } |
| 301 | |
| 302 | async importFromCode(code: string) { |
| 303 | await this.switchToTab("tab-import"); |
| 304 | await this.page.type('[data-testid="import-input"]', code); |
| 305 | await this.page.click('[data-testid="stack-select"]'); |
| 306 | await this.page.waitForSelector('[role="option"]', { timeout: 5000 }); |
| 307 | await this.page.evaluate(() => { |
| 308 | const options = Array.from( |
| 309 | document.querySelectorAll('[role="option"]') |
| 310 | ) as HTMLElement[]; |
| 311 | const target = options.find((option) => |
| 312 | option.textContent?.includes("HTML + Tailwind") |
| 313 | ); |
| 314 | target?.click(); |
| 315 | }); |
| 316 | await this.takeScreenshot("typed_code"); |
| 317 | await this.page.click('[data-testid="import-submit"]'); |
| 318 | await this.waitUntilVersionIsReady("v1"); |
| 319 | } |
| 320 | |
| 321 | async edit(edit: string, version: string) { |
| 322 | await this.page.type('[data-testid="update-input"]', edit); |
no test coverage detected