Skip to content

Commit

Permalink
chore: Add testId field
Browse files Browse the repository at this point in the history
  • Loading branch information
hetunandu committed Dec 18, 2024
1 parent 45d12ff commit 56fddd3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/client/src/IDE/Components/Sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ function IDESidebar(props: IDESidebarProps) {
key={button.state}
onClick={onClick}
selected={editorState === button.state}
testId={button.testId}
title={button.title}
tooltip={button.tooltip}
urlSuffix={button.urlSuffix}
Expand All @@ -58,6 +59,7 @@ function IDESidebar(props: IDESidebarProps) {
key={button.state}
onClick={onClick}
selected={editorState === button.state}
testId={button.testId}
title={button.title}
tooltip={button.tooltip}
urlSuffix={button.urlSuffix}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const ConditionConfig: Record<Condition, { icon: string; color: string }> = {

export interface SidebarButtonProps {
title?: string;
testId: string;
selected: boolean;
icon: string;
onClick: (urlSuffix: string) => void;
Expand Down Expand Up @@ -82,6 +83,7 @@ function SidebarButton(props: SidebarButtonProps) {
<IconContainer
className={`t--sidebar-${title || tooltip}`}
data-selected={selected}
data-testid={"t--sidebar-" + props.testId}
onClick={handleOnClick}
role="button"
selected={selected}
Expand Down
4 changes: 4 additions & 0 deletions app/client/src/ce/entities/IDE/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export const TopButtons: IDESidebarButton[] = [
state: EditorState.EDITOR,
icon: "editor-v3",
title: SidebarTopButtonTitles.EDITOR,
testId: SidebarTopButtonTitles.EDITOR,
urlSuffix: "",
},
];
Expand All @@ -71,18 +72,21 @@ export const BottomButtons: IDESidebarButton[] = [
state: EditorState.DATA,
icon: "datasource-v3",
tooltip: SidebarBottomButtonTitles.DATA,
testId: SidebarBottomButtonTitles.DATA,
urlSuffix: "datasource",
},
{
state: EditorState.LIBRARIES,
icon: "packages-v3",
tooltip: SidebarBottomButtonTitles.LIBRARIES,
testId: SidebarBottomButtonTitles.LIBRARIES,
urlSuffix: "libraries",
},
{
state: EditorState.SETTINGS,
icon: "settings-v3",
tooltip: SidebarBottomButtonTitles.SETTINGS,
testId: SidebarBottomButtonTitles.SETTINGS,
urlSuffix: "settings",
},
];
Expand Down

0 comments on commit 56fddd3

Please sign in to comment.