Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work for #4847: implement focus state for expanded panel in property grid #4905

Merged
merged 3 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,11 @@
cursor: default;
}

.spg-panel__title--expandable:not(.spg-panel__title[aria-expanded=true]) {

&:hover,
&:focus {
background-color: $background-dim;
}
.spg-panel__title--collapsed:hover,
.spg-panel__title--expandable:focus {
background-color: $background-dim;
}

.spg-panel__title[aria-expanded=true],
.spg-panel__title--expanded {
color: $foreground;
font-weight: 600;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export var propertyGridCss = {
panel: {
title: "spg-title spg-panel__title",
titleExpandable: "spg-panel__title--expandable",
titleOnExpand: "spg-panel__title--expanded",
titleExpanded: "spg-panel__title--expanded",
titleCollapsed: "spg-panel__title--collapsed",
titleOnError: "spg-panel__title--error",
description: "spg-description spg-panel__description",
container: "spg-panel spg-row__panel",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion visualRegressionTests/tests/designer/multiple-text.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Selector } from "testcafe";
import { ClientFunction, Selector } from "testcafe";
import { url, setJSON, getPropertyGridCategory, generalGroupName, wrapVisualTest, takeElementScreenshot } from "../../helper";

const title = "MultipleText Screenshot";
Expand Down Expand Up @@ -38,6 +38,7 @@ test("Multiple text items", async (t) => {
await t
.click(Selector(".sd-question"))
.click(getPropertyGridCategory("Items"));
await ClientFunction(() => document.body.focus())();
await takeElementScreenshot("multiple-text-items.png", Selector(".svc-side-bar .spg-panel").nth(1), t, comparer);
});
});
20 changes: 18 additions & 2 deletions visualRegressionTests/tests/designer/pg-editors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,24 @@ test("Check accepted file types hint link", async (t) => {
await takeElementScreenshot("file-accepted-types-hint.png", Selector("[data-name='acceptedTypes']"), t, comparer);
});
});

test("Check property grid panel' header states", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await setJSON({});
await t.resizeWindow(1920, 1920);
const headerSelector = Selector("h4[aria-label=General]").nth(0);
await t
.click(headerSelector);
await takeElementScreenshot("pg-panel-header-expanded-focused.png", headerSelector, t, comparer);
await t.pressKey("tab");
await takeElementScreenshot("pg-panel-header-expanded.png", headerSelector, t, comparer);
await t
.click(headerSelector);
await takeElementScreenshot("pg-panel-header-collapsed-focused.png", headerSelector, t, comparer);
await t.pressKey("tab");
await resetHoverToCreator(t);
await takeElementScreenshot("pg-panel-header-collapsed.png", headerSelector, t, comparer);
});
});
test("Dropdown input in property grid", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(1240, 870);
Expand All @@ -677,4 +694,3 @@ test("Dropdown input in property grid", async (t) => {
await takeElementScreenshot("pg-dropdown-editor-input.png", Selector(".spg-dropdown[aria-label='Survey language']"), t, comparer);
});
});

5 changes: 5 additions & 0 deletions visualRegressionTests/tests/designer/theme-tab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,25 +66,30 @@ test("theme setting property grid", async (t) => {
const westResizer = Selector(".svc-resizer-west");
await t.drag(westResizer, -150, 0);

await ClientFunction(() => document.body.focus())();
await takeElementScreenshot("theme-editor-property-grid-general-group.png", expandedGroup, t, comparer);

await t.click(getPropertyGridCategory("General"));
await t.click(getPropertyGridCategory("Header"));
await ClientFunction(() => document.body.focus())();
await takeElementScreenshot("theme-editor-property-grid-header-group.png", expandedGroup, t, comparer);

await t.click(expandedGroup.find(".sv-button-group__item-caption").withText("Advanced"));
await takeElementScreenshot("theme-editor-property-grid-header-group-advanced.png", expandedGroup, t, comparer);

await t.click(getPropertyGridCategory("Header"));
await t.click(getPropertyGridCategory("Background"));
await ClientFunction(() => document.body.focus())();
await takeElementScreenshot("theme-editor-property-grid-background-group.png", expandedGroup, t, comparer);

await t.click(getPropertyGridCategory("Background"));
await t.click(getPropertyGridCategory("Appearance"));
await ClientFunction(() => document.body.focus())();
await takeElementScreenshot("theme-editor-property-grid-appearance-group.png", expandedGroup, t, comparer);

await t.click(getPropertyGridCategory("Appearance"));
await t.click(getPropertyGridCategory("Advanced"));
await ClientFunction(() => document.body.focus())();
await takeElementScreenshot("theme-editor-property-grid-advanced-group.png", expandedGroup, t, comparer);
});
});