-
Notifications
You must be signed in to change notification settings - Fork 779
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Survey-React, conditional rendering is broken with inline questi…
- Loading branch information
1 parent
d81d7c1
commit 66f074b
Showing
4 changed files
with
112 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { frameworks, url, initSurvey, getSurveyResult } from "../helper"; | ||
import { Selector, ClientFunction } from "testcafe"; | ||
const assert = require("assert"); | ||
const title = `Elements Visibility on Same row`; | ||
|
||
const json = { | ||
pages: [ | ||
{ | ||
elements: [ | ||
{ type: "radiogroup", name: "q1", choices: ["Yes", "No"] }, | ||
{ | ||
type: "text", | ||
name: "q2", | ||
startWithNewLine: false, | ||
visibleIf: "{q1} = 'Yes'", | ||
}, | ||
], | ||
}, | ||
], | ||
}; | ||
|
||
frameworks.forEach((framework) => { | ||
fixture`${framework} ${title}`.page`${url}${framework}`.beforeEach( | ||
async (t) => { | ||
await initSurvey(framework, json); | ||
} | ||
); | ||
test(`make element on same row visible`, async (t) => { | ||
await t.expect(Selector("span").withText("2.").visible).notOk(); | ||
const yesChoice = Selector(`input[value="Yes"]`); | ||
const noChoice = Selector(`input[value="No"]`); | ||
await t | ||
.click(yesChoice) | ||
.expect(yesChoice.checked) | ||
.ok(); | ||
await t.expect(Selector("span").withText("2.").visible).ok(); | ||
await t | ||
.click(noChoice) | ||
.expect(noChoice.checked) | ||
.ok(); | ||
await t.expect(Selector("span").withText("2.").visible).notOk(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters