Skip to content

Commit

Permalink
#6487 Missing tooltips on page, panel, and question expand/collapse (#…
Browse files Browse the repository at this point in the history
…6506)

Fixes #6487
  • Loading branch information
novikov82 authored Feb 3, 2025
1 parent 5519d64 commit fce084c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
24 changes: 24 additions & 0 deletions functionalTests/designer/question-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,30 @@ test("Question adorner - collapse button in differen modes", async (t) => {
await ClientFunction(() => { window["creator"].expandCollapseButtonVisibility = "never"; })();
});

test("Question and page collapse button title", async (t) => {
await ClientFunction(() => { window["creator"].expandCollapseButtonVisibility = "always"; })();
await t.resizeWindow(1920, 1080);
const json = {
elements: [
{
type: "text",
name: "question1"
}
]
};
await setJSON(json);
await t.hover(getToolboxItemByText("Single-Line Input"));
const qCollapseButton = Selector(".svc-question__content #collapse button");
await t.expect(qCollapseButton.getAttribute("title")).eql("Collapse");
await t.click(qCollapseButton);
await t.expect(qCollapseButton.getAttribute("title")).eql("Expand");

const pCollapseButton = Selector(".svc-page__content #collapse button");
await t.expect(pCollapseButton.getAttribute("title")).eql("Collapse");
await t.click(pCollapseButton);
await t.expect(pCollapseButton.getAttribute("title")).eql("Expand");
});

test("Question adorner - do not render content when initially collapsed", async (t) => {
const json = {
elements: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ export class SurveyElementAdornerBase<T extends SurveyElement = SurveyElement> e
return {
id: "collapse",
css: "sv-action-bar-item--collapse",
locTooltipName: new ComputedUpdater<string>(() => this.collapsed ? "ed.expandTooltip" : "ed.collapseTooltip") as any,
iconName: new ComputedUpdater<string>(() => this.collapsed ? expandIcon : collapseIcon) as any,
iconSize: "auto",
action: () => {
Expand Down
2 changes: 2 additions & 0 deletions packages/survey-creator-core/src/localization/english.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ export var enStrings = {
redo: "Redo",
undoTooltip: "Undo last change",
redoTooltip: "Redo the change",
expandTooltip: "Expand",
collapseTooltip: "Collapse",
expandAllTooltip: "Expand All",
collapseAllTooltip: "Collapse All",
zoomInTooltip: "Zoom In",
Expand Down

0 comments on commit fce084c

Please sign in to comment.