|
1 | 1 | import React from "react";
|
2 |
| -import { AutoForm } from "@autoform/mui"; |
| 2 | +import { AutoForm } from "@autoform/mantine"; |
3 | 3 | import { ZodProvider, fieldConfig } from "@autoform/zod";
|
4 | 4 | import { z } from "zod";
|
5 | 5 | import { TestWrapper } from "./utils";
|
@@ -59,16 +59,19 @@ describe("AutoForm Advanced Features Tests", () => {
|
59 | 59 | </TestWrapper>
|
60 | 60 | );
|
61 | 61 |
|
62 |
| - cy.get(".MuiFormControl-root") |
| 62 | + cy.get(".mantine-InputWrapper-root") |
63 | 63 | .eq(0)
|
64 | 64 | .find("input")
|
65 | 65 | .should("have.attr", "name", "username");
|
66 |
| - cy.get(".MuiFormControl-root") |
| 66 | + cy.get(".mantine-InputWrapper-root") |
67 | 67 | .eq(1)
|
68 | 68 | .find("input")
|
69 | 69 | .should("have.attr", "name", "password");
|
70 |
| - cy.get(".MuiFormControl-root").eq(2).find(".MuiSelect-select"); |
71 |
| - cy.get(".MuiFormControl-root") |
| 70 | + cy.get(".mantine-InputWrapper-root") |
| 71 | + .eq(2) |
| 72 | + .find(".mantine-Select-wrapper") |
| 73 | + .find("input"); |
| 74 | + cy.get(".mantine-InputWrapper-root") |
72 | 75 | .eq(3)
|
73 | 76 | .find("input")
|
74 | 77 | .should("have.attr", "name", "bio");
|
@@ -119,14 +122,14 @@ describe("AutoForm Advanced Features Tests", () => {
|
119 | 122 | </TestWrapper>
|
120 | 123 | );
|
121 | 124 |
|
122 |
| - cy.get('.MuiSelect-select[aria-labelledby*="favoriteColor"]').should( |
123 |
| - "exist" |
124 |
| - ); |
125 |
| - cy.get('.MuiSelect-select[aria-labelledby*="favoriteColor"]').click(); |
126 |
| - cy.get('.MuiMenu-list[role="listbox"] .MuiMenuItem-root').should( |
127 |
| - "have.length", |
128 |
| - 3 |
129 |
| - ); |
| 125 | + cy.get(".mantine-Select-input").eq(0).click(); |
| 126 | + |
| 127 | + cy.get(".mantine-Popover-dropdown").within(() => { |
| 128 | + cy.contains("red").should("exist"); |
| 129 | + cy.contains("green").should("exist"); |
| 130 | + cy.contains("blue").should("exist"); |
| 131 | + }); |
| 132 | + // mantine select fields portal has auto-generated aria-label and names. |
130 | 133 | });
|
131 | 134 |
|
132 | 135 | it("renders textarea field correctly", () => {
|
|
0 commit comments