Testing Accordion State Persistence and Text Transformation in gradio-app
This test suite validates the interaction between accordion and slider components in the Gradio application, focusing on state persistence and value transformations. The tests ensure proper component behavior during user interactions and state changes.
Test Coverage Overview
Implementation Analysis
Technical Details
Best Practices Demonstrated
gradio-app/gradio
js/spa/test/blocks_flipper.spec.ts
import { test, expect } from "@self/tootils";
test("accordion stays open when interacting with the slider", async ({
page
}) => {
await page.getByRole("button", { name: "Open for More! ▼" }).click();
await page.getByLabel("Textbox").nth(0).fill("123");
await page.getByRole("button", { name: "Flip" }).click();
await expect(page.getByLabel("Textbox").nth(1)).toHaveValue("321");
await expect(page.getByText("Look at me...")).toBeVisible();
});