fix: button descendant console error (#4468)

This commit is contained in:
Dhruwang Jariwala
2024-12-16 13:47:35 +05:30
committed by GitHub
parent 971053c90d
commit da167642b7
3 changed files with 5 additions and 6 deletions

View File

@@ -31,8 +31,7 @@ export const StartFromScratchTemplate = ({
const t = useTranslations();
const customSurvey = getCustomSurveyTemplate(locale);
return (
<button
type="button"
<div
onClick={() => {
if (noPreview) {
createSurvey(customSurvey);
@@ -62,6 +61,6 @@ export const StartFromScratchTemplate = ({
</Button>
</div>
)}
</button>
</div>
);
};

View File

@@ -236,7 +236,7 @@ test.describe("Multi Language Survey Create", async () => {
await page.getByRole("button", { name: "Save changes" }).click();
await page.waitForTimeout(2000);
await page.getByRole("link", { name: "Surveys" }).click();
await page.getByRole("button", { name: "Start from scratch Create a" }).click();
await page.getByText("Start from scratch").click();
await page.getByRole("button", { name: "Create survey", exact: true }).click();
await page.locator("#multi-lang-toggle").click();
await page.getByRole("combobox").click();

View File

@@ -138,7 +138,7 @@ export const signupUsingInviteToken = async (page: Page, name: string, email: st
export const createSurvey = async (page: Page, params: CreateSurveyParams) => {
const addQuestion = "Add questionAdd a new question to your survey";
await page.getByRole("button", { name: "Start from scratch Create a" }).click();
await page.getByText("Start from scratch").click();
await page.getByRole("button", { name: "Create survey", exact: true }).click();
await page.waitForURL(/\/environments\/[^/]+\/surveys\/[^/]+\/edit$/);
@@ -326,7 +326,7 @@ export const createSurvey = async (page: Page, params: CreateSurveyParams) => {
export const createSurveyWithLogic = async (page: Page, params: CreateSurveyWithLogicParams) => {
const addQuestion = "Add questionAdd a new question to your survey";
await page.getByRole("button", { name: "Start from scratch Create a" }).click();
await page.getByText("Start from scratch").click();
await page.getByRole("button", { name: "Create survey", exact: true }).click();
await page.waitForURL(/\/environments\/[^/]+\/surveys\/[^/]+\/edit$/);