Skip to content

Commit

Permalink
tests: sad
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnavK-09 committed Jan 30, 2025
1 parent f04fc63 commit 0b17259
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions playwright-tests/circuit-json-import.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ test.beforeEach(async ({ page }) => {
test("should open the Circuit Json Import Dialog", async ({ page }) => {
const importButton = page.locator('button:has-text("Import Circuit JSON")')
await importButton.click()

const dialog = page.locator(".Dialog")
await expect(dialog).toBeVisible()
await expect(page.getByRole("dialog")).toBeVisible()
})

test("should handle valid Circuit JSON input", async ({ page }) => {
Expand Down Expand Up @@ -84,7 +82,13 @@ test("should handle invalid Circuit JSON file upload", async ({ page }) => {
await importButton.click()

const fileInput = page.locator('input[type="file"]')
await fileInput.setInputFiles("path/to/invalid/circuit.txt")
await fileInput.setInputFiles({
name: "circuit.json",
mimeType: "application/json",
buffer: new Blob([JSON.stringify({})], {
type: "application/json",
}),
})

const importDialogButton = page.locator('button:has-text("Import")')
await importDialogButton.click()
Expand Down

0 comments on commit 0b17259

Please sign in to comment.