Skip to content

Commit

Permalink
resolve #7278 Auto-Translation Dialog Issues
Browse files Browse the repository at this point in the history
  • Loading branch information
OlgaLarina committed Nov 1, 2023
1 parent 1d02fff commit f7d708b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/question_comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ export class QuestionCommentModel extends QuestionTextBase {
event.stopPropagation();
}
}
protected setQuestionValue(newValue: any, updateIsAnswered: boolean = true): void {
super.setQuestionValue(newValue, updateIsAnswered);
this.updateElement();
}
onValueChanged(): void {
super.onValueChanged();
this.updateElement();
Expand Down
21 changes: 20 additions & 1 deletion testCafe/questions/comment.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { frameworks, url, setOptions, initSurvey, getSurveyResult, getQuestionValue, getQuestionJson } from "../helper";
import { Selector } from "testcafe";
import { ClientFunction, Selector } from "testcafe";
const title = "comment";

const commentQuestion = Selector(".sv_q textarea");
Expand Down Expand Up @@ -78,6 +78,25 @@ frameworks.forEach(framework => {
.expect(commentQuestion.nth(2).value).eql("aaaa");
});

test("autoGrowComment after survey data set", async t => {
await initSurvey(framework, {
"elements": [
{
"type": "comment",
"name": "question1",
"autoGrow": true,
"rows": 1
}
]
});
await t.expect(commentQuestion.clientHeight).eql(32);

await ClientFunction(() =>
window["survey"].data = { "question1": "<h3>Thank you for your feedback.</h3> <h5> We are glad that you share with us your ideas.We highly value all suggestions from our customers. We do our best to improve the product and reach your expectation.</h5><br/>" }
)();
await t.expect(commentQuestion.clientHeight).eql(60);
});

test("fill textarea", async t => {
await initSurvey(framework, json);
await t
Expand Down

0 comments on commit f7d708b

Please sign in to comment.