Skip to content

Add data-testid to all React Components_9: 110185823 #1472

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions src/components/common/ProofStatusDropDown.tsx
Original file line number Diff line number Diff line change
@@ -91,7 +91,7 @@ const StatusDropdown: React.FC<StatusDropdownProps> = observer(
}, [shouldSetAccepted, proofId, onStatusUpdate]);

return (
<div
<div data-testid="status-dropdown-component"
style={{
display: 'flex',
alignItems: 'center',
@@ -148,4 +148,4 @@ const StatusDropdown: React.FC<StatusDropdownProps> = observer(
}
);

export default StatusDropdown;
export default StatusDropdown;
4 changes: 2 additions & 2 deletions src/components/common/QR.tsx
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ export default function QR(props: QRProps) {
);

return (
<div style={{ position: 'relative' }}>
<div data-testid="qr-component" style={{ position: 'relative' }}>
<QRCode
data-testid={'testid-qrcode'}
bgColor={color.pureWhite}
@@ -83,4 +83,4 @@ export default function QR(props: QRProps) {
)}
</div>
);
}
}
3 changes: 2 additions & 1 deletion src/components/common/RefineDescriptionModal/index.tsx
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ export const RefineDescriptionModal = () => {

return (
<EuiPopover
data-testid="refine-description-modal-component"
button={
<ActionButton
onClick={togglePopover}
@@ -50,4 +51,4 @@ export const RefineDescriptionModal = () => {
</EuiText>
</EuiPopover>
);
};
};
3 changes: 2 additions & 1 deletion src/components/common/SearchBar.tsx
Original file line number Diff line number Diff line change
@@ -133,6 +133,7 @@ function SearchBar({

return (
<Container
data-testid="search-bar-component"
style={{ position: 'relative' }}
border={border}
borderActive={borderActive}
@@ -210,4 +211,4 @@ function SearchBar({
</Container>
);
}
export default observer(SearchBar);
export default observer(SearchBar);
4 changes: 2 additions & 2 deletions src/components/common/SearchTextInput.tsx
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ function SearchTextInput(props: SearchTextInputProps) {
}

return (
<div style={{ position: 'relative' }}>
<div data-testid="search-text-input-component" style={{ position: 'relative' }}>
<Text
{...props}
onFocus={() => setExpand(true)}
@@ -100,4 +100,4 @@ function SearchTextInput(props: SearchTextInputProps) {
);
}

export default observer(SearchTextInput);
export default observer(SearchTextInput);
4 changes: 2 additions & 2 deletions src/components/common/SearchableSelect.tsx
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ export default function SearchableSelect(props: SelProps) {
: [];

return (
<div id="dropdown-wrapper" style={{ position: 'relative', ...style }}>
<div data-testid="searchable-select-component" id="dropdown-wrapper" style={{ position: 'relative', ...style }}>
<S
options={opts}
isLoading={loading}
@@ -55,4 +55,4 @@ export default function SearchableSelect(props: SelProps) {
/>
</div>
);
}
}
4 changes: 2 additions & 2 deletions src/components/common/Select.tsx
Original file line number Diff line number Diff line change
@@ -143,7 +143,7 @@ export default function CustomSelect(props: SelProps) {
};

return (
<DropdownContainer ref={dropdownRef} style={{ ...props.style }} data-testid={props.testId}>
<DropdownContainer data-testid="custom-select-component" ref={dropdownRef} style={{ ...props.style }} data-testid={props.testId}>
<StyledLabel isFocused={isFocused} hasContent={props.value}>
{props.placeholder}
</StyledLabel>
@@ -167,4 +167,4 @@ export default function CustomSelect(props: SelProps) {
</DropdownOptions>
</DropdownContainer>
);
}
}
4 changes: 2 additions & 2 deletions src/components/common/SidebarComponent.test.tsx
Original file line number Diff line number Diff line change
@@ -63,7 +63,7 @@ const mockChats: Chat[] = [

const renderSidebar = (props: any) =>
render(
<BrowserRouter>
<BrowserRouter data-testid="sidebar-component-component">
<SidebarComponent uuid="test-uuid" workspaces={[]} {...props} />
</BrowserRouter>
);
@@ -174,4 +174,4 @@ describe('SidebarComponent Chat Section', () => {
expect(screen.getByText('No date')).toBeInTheDocument();
});
});
});
});
3 changes: 2 additions & 1 deletion src/components/common/SidebarComponent.tsx
Original file line number Diff line number Diff line change
@@ -648,6 +648,7 @@ export default function SidebarComponent({

return (
<SidebarContainer
data-testid="sidebar-component"
collapsed={collapsed}
onClick={(e) => {
e.stopPropagation();
@@ -1107,4 +1108,4 @@ export default function SidebarComponent({
)}
</SidebarContainer>
);
}
}