Skip to content

Commit 1e15dcc

Browse files
authored
chore(web): improve accessibility in feature's component (#1585)
1 parent 610c93e commit 1e15dcc

File tree

22 files changed

+54
-13
lines changed

22 files changed

+54
-13
lines changed

web/src/beta/features/AccountSetting/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const AccountSetting: FC = () => {
5151
return (
5252
<>
5353
<SettingBase tabs={tabs} tab={"account"}>
54-
<InnerPage wide>
54+
<InnerPage data-testid="inner-page" wide>
5555
<SettingsWrapper>
5656
<TitleWrapper size="body" weight="bold">
5757
{t("Account")}

web/src/beta/features/CursorStatus/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const CursorStatus: FC = () => {
4646
enabled &&
4747
inView && (
4848
<Wrapper left={mousePosition.x + offsetX} top={mousePosition.y + offsetY}>
49-
<Loader />
49+
<Loader data-testid="loader" />
5050
</Wrapper>
5151
)
5252
);

web/src/beta/features/Dashboard/ContentsContainer/RecycleBin/items/RecycleBinItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const RecycleBinItem: FC<Prop> = ({
4747
];
4848

4949
return (
50-
<Card>
50+
<Card data-testid={`recycle-bin-item-${project?.id}`}>
5151
<CardImage
5252
backgroundImage={project?.imageUrl ?? defaultProjectBackgroundImage}
5353
isHovered={isHovered ?? false}

web/src/beta/features/Dashboard/LeftSidePanel/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const LeftSidePanel: FC<Props> = ({
3636
onWorkspaceChange
3737
}) => {
3838
return (
39-
<SidebarWrapper>
39+
<SidebarWrapper data-testid="left-side-panel">
4040
<SidebarMainSection>
4141
<LogoWrapper />
4242
<SidebarDivider />
@@ -57,6 +57,7 @@ const LeftSidePanel: FC<Props> = ({
5757
icon={tab.icon}
5858
active={tab.id === currentTab}
5959
disabled={tab.disabled}
60+
data-testid={`sidebar-tab-${tab.id}`}
6061
tileComponent={tab.tileComponent}
6162
/>
6263
))}
@@ -76,6 +77,7 @@ const LeftSidePanel: FC<Props> = ({
7677
icon={tab.icon}
7778
active={tab.id === currentTab}
7879
disabled={tab.disabled}
80+
data-testid={`sidebar-tab-${tab.id}`}
7981
tileComponent={tab.tileComponent}
8082
/>
8183
))}

web/src/beta/features/Editor/Map/InspectorPanel/LayerInspector/DataSource/SketchCustomProperties/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ const CustomPropertiesSchema: FC<Props> = ({
6262
{sortedValues?.map(({ key, value }) => (
6363
<CustomPropertyFieldItem
6464
key={key}
65+
data-testid={`custom-property-field-${key}`}
6566
title={key}
6667
icon={getIcon(value)}
6768
openCustomPropertySchema={() => handleEditField(key, value)}

web/src/beta/features/Editor/Map/InspectorPanel/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ const InspectorPanel: FC<Props> = ({ areaRef, showCollapseArea }) => {
3636
return (
3737
<Panel
3838
title={t("Inspector")}
39+
dataTestid="editor-map-inspector-panel"
3940
storageId="editor-map-inspector-panel"
4041
extend
4142
alwaysOpen

web/src/beta/features/Editor/Map/LayerStylePanel/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ const StylesPanel: FC<Props> = ({ showCollapseArea, areaRef }) => {
5858
showCollapseArea={showCollapseArea}
5959
areaRef={areaRef}
6060
noPadding
61+
dataTestid="editor-map-scene-panel"
6162
>
6263
<LayerStyleManager onClick={() => handleSelectLayerStyle(undefined)}>
6364
<ActionsWrapper>

web/src/beta/features/Editor/Map/LayersPanel/LayerItem.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ const LayerItem: FC<LayerItemProps> = ({
185185
optionsMenu={optionsMenu}
186186
optionsMenuWidth={150}
187187
actions={hoverActions}
188+
dataTestid="layer-item"
188189
/>
189190
{showDeleteLayerConfirmModal && (
190191
<ConfirmModal

web/src/beta/features/Editor/Map/LayersPanel/index.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,12 @@ const LayersPanel: FC = () => {
8282
);
8383

8484
return (
85-
<Panel title={t("Layers")} storageId="editor-map-layers-panel" extend>
85+
<Panel
86+
dataTestid="editor-map-layers-panel"
87+
title={t("Layers")}
88+
storageId="editor-map-layers-panel"
89+
extend
90+
>
8691
<Wrapper>
8792
<PopupMenu
8893
label={
@@ -105,9 +110,8 @@ const LayersPanel: FC = () => {
105110
onMoveStart={handleMoveStart}
106111
dragDisabled={false}
107112
/>
108-
<EmptySpace onClick={() => handleLayerSelect(undefined)} />
113+
<EmptySpace data-testid="empty-space" onClick={() => handleLayerSelect(undefined)} />
109114
</LayersContainer>
110-
111115
</Wrapper>
112116
</Panel>
113117
);

web/src/beta/features/Editor/Map/ScenePanel/index.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ const ScenePanel: FC = () => {
3434
);
3535

3636
return (
37-
<Panel title={t("Scene")} storageId="editor-map-scene-panel">
37+
<Panel
38+
title={t("Scene")}
39+
storageId="editor-map-scene-panel"
40+
dataTestid="editor-map-scene-panel"
41+
>
3842
<Wrapper>
3943
{[
4044
...new Set(
@@ -48,6 +52,7 @@ const ScenePanel: FC = () => {
4852
title={handleTranslatedCollectionName(
4953
collection as ScenePropertyCollection
5054
)}
55+
dataTestid="editor-map-scene-item"
5156
highlighted={selectedSceneSetting === collection}
5257
onClick={() => handleSceneSettingSelect(collection)}
5358
/>

0 commit comments

Comments
 (0)