Skip to content

Commit

Permalink
Merge branch 'master' into bug/6164-a11y-dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-kurmanov committed May 11, 2023
2 parents 7a76ba0 + df88499 commit db78fd1
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 11 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.

## [1.9.87](https://github.com/surveyjs/survey-library/compare/v1.9.86...v1.9.87) (2023-05-11)

## [1.9.86](https://github.com/surveyjs/survey-library/compare/v1.9.85...v1.9.86) (2023-05-03)

## [1.9.85](https://github.com/surveyjs/survey-library/compare/v1.9.84...v1.9.85) (2023-04-25)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"testcafe:ci:angular": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless testCafe/ --app \"http-server ./packages/survey-angular-ui/example/dist --proxy http://localhost:8080? -p 8080\" --selector-timeout 1500 --reporter minimal --env=angular",
"prepare": "husky install"
},
"version": "1.9.86",
"version": "1.9.87",
"name": "survey-library",
"private": true,
"devDependencies": {
Expand Down
2 changes: 2 additions & 0 deletions packages/survey-angular-ui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.

## [1.9.87](https://github.com/surveyjs/surveyjs/compare/v1.9.86...v1.9.87) (2023-05-11)

## [1.9.86](https://github.com/surveyjs/surveyjs/compare/v1.9.85...v1.9.86) (2023-05-03)

## [1.9.85](https://github.com/surveyjs/surveyjs/compare/v1.9.84...v1.9.85) (2023-04-25)
Expand Down
2 changes: 1 addition & 1 deletion packages/survey-angular-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "survey-angular-ui",
"version": "1.9.86",
"version": "1.9.87",
"description": "survey.js is a JavaScript Survey Library. It is a modern way to add a survey to your website. It uses JSON for survey metadata and results.",
"keywords": [
"Survey",
Expand Down
2 changes: 1 addition & 1 deletion src/question_rating.ts
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ Serializer.addClass(
name: "autoGenerate",
category: "rateValues",
default: true,
choices: [{ value: true, text: "Generate" }, { value: false, text: "Enter manually" }],
choices: [true, false],
visibleIndex: 4
},
{
Expand Down
3 changes: 0 additions & 3 deletions src/react/tagbox-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ export class SurveyQuestionTagboxItem extends ReactSurveyElement {
constructor(props: any) {
super(props);
}
protected getStateElement(): Base {
return this.item;
}
protected get question(): QuestionTagboxModel {
return this.props.question;
}
Expand Down
4 changes: 2 additions & 2 deletions src/survey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3266,7 +3266,7 @@ export class SurveyModel extends SurveyElementCore
);
}
/**
* Returns `true`, if a user has already completed the survey in this browser and there is a cookie about it. Survey goes to `completed` state if the function returns `true`.
* Returns `true`, if a user has already completed the survey in this browser and there is a cookie about it. Survey goes to `completedbefore` state if the function returns `true`.
* @see cookieName
* @see setCookie
* @see deleteCookie
Expand Down Expand Up @@ -5538,7 +5538,7 @@ export class SurveyModel extends SurveyElementCore
this.onQuestionsOnPageModeChanged("standard");
super.endLoadingFromJson();
if (this.hasCookie) {
this.doComplete();
this.isCompletedBefore = true;
}
this.doElementsOnLoad();
this.isEndLoadingFromJson = "conditions";
Expand Down
35 changes: 35 additions & 0 deletions testCafe/questions/tagbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,41 @@ frameworks.forEach((framework) => {
.expect(selectedItems.count).eql(0);
});

test("tagbox selected list items", async (t) => {
await initSurvey(framework, jsonCloseOnSelectIsDefault);
const popupContainer = Selector(".sv-popup__container").filterVisible();
const selectedListItem = Selector(".sv-list__item--selected");

await t
.expect(popupContainer.visible).notOk()
.click(questionTagbox)
.expect(popupContainer.visible).ok()

.click(getListItemByText("item1"))
.click(getListItemByText("item2"))
.click(getListItemByText("item3"))
.expect(selectedItems.count).eql(3)
.expect(selectedListItem.count).eql(3)
.expect(selectedListItem.nth(0).textContent).contains("item1")
.expect(selectedListItem.nth(1).textContent).contains("item2")
.expect(selectedListItem.nth(2).textContent).contains("item3")

.click(getListItemByText("item1"))
.click(getListItemByText("item2"))
.click(getListItemByText("item3"))
.expect(selectedItems.count).eql(0)
.expect(selectedListItem.count).eql(0)

.click(getListItemByText("item1"))
.click(getListItemByText("item2"))
.click(getListItemByText("item3"))
.expect(selectedItems.count).eql(3)
.expect(selectedListItem.count).eql(3)
.expect(selectedListItem.nth(0).textContent).contains("item1")
.expect(selectedListItem.nth(1).textContent).contains("item2")
.expect(selectedListItem.nth(2).textContent).contains("item3");
});

test("tagbox editing. CloseOnSelect is default", async (t) => {
await initSurvey(framework, jsonCloseOnSelectIsDefault);
await t
Expand Down
4 changes: 2 additions & 2 deletions testCafe/survey/cookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ frameworks.forEach(framework => {
.navigateTo(url + framework);
await initSurvey(framework, json);

await t.expect(Selector(".sv_completed_page h3").withText("Thank you for completing the survey").visible).ok();
await t.expect(Selector(".sv_body h3").withText("Our records show that you have already completed this survey.").visible).ok();
await deleteCookie();
await t.hover("input[type=checkbox]");

await t.expect(Selector(".sv_completed_page h3").withText("Thank you for completing the survey").exist).notOk();
await t.expect(Selector(".sv_body h3").withText("Our records show that you have already completed this survey.").exist).notOk();
});
});
2 changes: 1 addition & 1 deletion tests/markup/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ function sortInlineStyles(str: string) {
div.querySelectorAll("*").forEach(el => {
if(!!el.getAttribute("style")) {
const inlineStyle = (<string>el.getAttribute("style")).replace(/(;)\s+|;$/g, "$1").split(";");
el.setAttribute("style", inlineStyle.sort((a: string, b: string) => a.localeCompare(b)).join("; ") + ";");
el.setAttribute("style", inlineStyle.sort((a: string, b: string) => a.localeCompare(b)).map((style => style.replace(/\s*(:)\s*/, "$1"))).join("; ") + ";");
}
});
return div.innerHTML;
Expand Down

0 comments on commit db78fd1

Please sign in to comment.