-
Notifications
You must be signed in to change notification settings - Fork 823
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
da6886f
commit 0f3f5c6
Showing
4 changed files
with
37 additions
and
11 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
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,21 @@ | ||
import { QuestionImagePickerModel } from "../src/question_imagepicker"; | ||
import { settings } from "../src/settings"; | ||
import { SurveyModel } from "../src/survey"; | ||
|
||
QUnit.test("Items number in run-time and design-time", function (assert) { | ||
settings.supportCreatorV2 = true; | ||
const json = { | ||
elements: [ | ||
{ type: "imagepicker", name: "q", choices: ["a", "b", "c"] } | ||
] | ||
}; | ||
const survey1 = new SurveyModel(json); | ||
const q1 = <QuestionImagePickerModel>survey1.getQuestionByName("q"); | ||
const survey2 = new SurveyModel(); | ||
survey2.setDesignMode(true); | ||
survey2.fromJSON(json); | ||
const q2 = <QuestionImagePickerModel>survey2.getQuestionByName("q"); | ||
assert.equal(q1.visibleChoices.length, 3, "There are 3 items in run-time"); | ||
assert.equal(q2.visibleChoices.length, 4, "There are 4 items in design-time"); | ||
settings.supportCreatorV2 = false; | ||
}); |