summaryrefslogtreecommitdiffhomepage
path: root/gui/src/renderer/components/cell
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2024-04-19 11:42:12 +0200
committerOskar Nyberg <oskar@mullvad.net>2024-04-19 11:42:12 +0200
commiteced1187524fb2d56341fa17749002cf9ed0df1c (patch)
tree7b4513be33bb6b037584a104ba4ec4a13a57a390 /gui/src/renderer/components/cell
parentf9e4201c906f1591ba8ae56eabacd69bbe9a0652 (diff)
parent9931f2c602ac9028bba7a05f52b86d707d77043f (diff)
downloadmullvadvpn-eced1187524fb2d56341fa17749002cf9ed0df1c.tar.xz
mullvadvpn-eced1187524fb2d56341fa17749002cf9ed0df1c.zip
Merge branch 'add-custom-bridge-test-des-820'
Diffstat (limited to 'gui/src/renderer/components/cell')
-rw-r--r--gui/src/renderer/components/cell/Selector.tsx10
1 files changed, 8 insertions, 2 deletions
diff --git a/gui/src/renderer/components/cell/Selector.tsx b/gui/src/renderer/components/cell/Selector.tsx
index e527017435..5e5d685a59 100644
--- a/gui/src/renderer/components/cell/Selector.tsx
+++ b/gui/src/renderer/components/cell/Selector.tsx
@@ -16,6 +16,8 @@ export interface SelectorItem<T> {
label: string;
value: T;
disabled?: boolean;
+ // eslint-disable-next-line @typescript-eslint/naming-convention
+ 'data-testid'?: string;
}
// T represents the available values and U represent the value of "Automatic"/"Any" if there is one.
@@ -51,7 +53,8 @@ export default function Selector<T, U>(props: SelectorProps<T, U>) {
isSelected={selected}
disabled={props.disabled || item.disabled}
forwardedRef={ref}
- onSelect={props.onSelect}>
+ onSelect={props.onSelect}
+ data-testid={item['data-testid']}>
{item.label}
</SelectorCell>
);
@@ -133,6 +136,8 @@ interface SelectorCellProps<T> {
onSelect: (value: T) => void;
children: React.ReactNode | Array<React.ReactNode>;
forwardedRef?: React.Ref<HTMLButtonElement>;
+ // eslint-disable-next-line @typescript-eslint/naming-convention
+ 'data-testid'?: string;
}
function SelectorCell<T>(props: SelectorCellProps<T>) {
@@ -150,7 +155,8 @@ function SelectorCell<T>(props: SelectorCellProps<T>) {
disabled={props.disabled}
role="option"
aria-selected={props.isSelected}
- aria-disabled={props.disabled}>
+ aria-disabled={props.disabled}
+ data-testid={props['data-testid']}>
<StyledCellIcon
$visible={props.isSelected}
source="icon-tick"