Skip to content

Commit

Permalink
updating data attributes naming convention to remove console warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitakinger committed Nov 6, 2024
1 parent e91ee0d commit 723332f
Show file tree
Hide file tree
Showing 23 changed files with 58 additions and 58 deletions.
46 changes: 23 additions & 23 deletions app/client/cypress/locators/OneClickBindingLocator.ts
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
export default {
connectData: '[data-testId="t--one-click-binding-connect-data"]',
connectData: '[data-testid="t--one-click-binding-connect-data"]',
datasourceDropdownSelector:
"[data-testId='t--one-click-binding-datasource-selector']",
"[data-testid='t--one-click-binding-datasource-selector']",
datasourceDropdownOptionSelector: (query: string) =>
`[data-testId="t--one-click-binding-datasource-trigger"]:contains(${query})`,
`[data-testid="t--one-click-binding-datasource-trigger"]:contains(${query})`,
dropdownOptionSelector: (query: string) =>
`[data-testId="t--one-click-binding-datasource-trigger"]:contains(${query})`,
`[data-testid="t--one-click-binding-datasource-trigger"]:contains(${query})`,
datasourceQueryBindHeaderSelector:
"[data-testId='t--one-click-binding-datasource-selector--bind-to-query']",
"[data-testid='t--one-click-binding-datasource-selector--bind-to-query']",
datasourceGenerateAQuerySelector:
"[data-testId='t--one-click-binding-datasource-selector--generate-a-query']",
"[data-testid='t--one-click-binding-datasource-selector--generate-a-query']",
datasourceOtherActionsSelector:
"[data-testId='t--one-click-binding-datasource-selector--other-actions']",
"[data-testid='t--one-click-binding-datasource-selector--other-actions']",
datasourceQuerySelector: (query?: string) =>
`[data-testId='t--one-click-binding-datasource-selector--query']${
`[data-testid='t--one-click-binding-datasource-selector--query']${
query ? `:contains(${query})` : ""
}`,
datasourceSelector: (datasource?: string) =>
`[data-testId="t--one-click-binding-datasource-selector--datasource"]${
`[data-testid="t--one-click-binding-datasource-selector--datasource"]${
datasource ? `:contains(${datasource})` : ""
}`,
otherActionSelector: (action?: string) =>
`[data-testId='t--one-click-binding-datasource-selector--other-action']${
`[data-testid='t--one-click-binding-datasource-selector--other-action']${
action ? `:contains(${action})` : ""
}`,
tableOrSpreadsheetDropdown:
'[data-testid="t--one-click-binding-table-selector"] .rc-select-selector',
tableOrSpreadsheetDropdownOption: (table?: string) =>
`//div[@data-testId='t--one-click-binding-table-selector--table']//div[text()='${table}']`,
`//div[@data-testid='t--one-click-binding-table-selector--table']//div[text()='${table}']`,
tableOrSpreadsheetSelectedOption: (table?: string) =>
`[data-testid="t--one-click-binding-table-selector"] .rc-select-selection-item${
table ? `:contains(${table})` : ""
}`,
validTableRowData:
'.t--widget-tablewidgetv2 [role="rowgroup"] [role="button"]',
tableError: (error: string) =>
`[data-testId="t--one-click-binding-table-selector--error"]:contains(${error})`,
dateInput: `[data-testId="datepicker-container"] input`,
`[data-testid="t--one-click-binding-table-selector--error"]:contains(${error})`,
dateInput: `[data-testid="datepicker-container"] input`,
dayViewFromDate: ".DayPicker-Day",
loadMore: "[data-testId='t--one-click-binding-datasource--load-more']",
datasourceSearch: `[data-testId="t--one-click-binding-datasource--search"]`,
loadMore: "[data-testid='t--one-click-binding-datasource--load-more']",
datasourceSearch: `[data-testid="t--one-click-binding-datasource--search"]`,
searchableColumn:
'[data-testId="t--one-click-binding-column-searchableColumn"]',
formType: '[data-testId="t--one-click-binding-column-formType"]',
defaultValues: '[data-testId="t--one-click-binding-column-defaultValues"]',
dataIdentifier: '[data-testId="t--one-click-binding-column-dataIdentifier"]',
label: '[data-testId="t--one-click-binding-column-label"]',
value: '[data-testId="t--one-click-binding-column-value"]',
'[data-testid="t--one-click-binding-column-searchableColumn"]',
formType: '[data-testid="t--one-click-binding-column-formType"]',
defaultValues: '[data-testid="t--one-click-binding-column-defaultValues"]',
dataIdentifier: '[data-testid="t--one-click-binding-column-dataIdentifier"]',
label: '[data-testid="t--one-click-binding-column-label"]',
value: '[data-testid="t--one-click-binding-column-value"]',
columnDropdownOption: (column: string, value?: string) =>
`[data-testId='t--one-click-binding-column-${column}--column']${
`[data-testid='t--one-click-binding-column-${column}--column']${
value ? `:contains(${value})` : ""
}`,
columnSelectedOption: (column: string, value?: string) =>
`[data-testId="t--one-click-binding-column-${column}"] .rc-select-selection-item${
`[data-testid="t--one-click-binding-column-${column}"] .rc-select-selection-item${
value ? `:contains(${value})` : ""
}`,
columnSelectorModalTrigger: '[data-testid="t--edit-fields-button"]',
Expand Down
4 changes: 2 additions & 2 deletions app/client/cypress/support/Pages/DataSources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export class DataSources {
_mandatoryMark = "//span[text()='*']";
_deleteDSHostPort = ".t--delete-field";
_dsTabSchema = "[data-testid='t--tab-SCHEMA_TAB']";
private _pageSelectionMenu = "[data-testId='t--page-selection']";
private _pageSelectionMenu = "[data-testid='t--page-selection']";

private _pageSelectMenuItem = ".ads-v2-menu__menu-item";

Expand Down Expand Up @@ -295,7 +295,7 @@ export class DataSources {
_imgFireStoreLogo = "//img[contains(@src, 'firestore.svg')]";
_dsVirtuosoElement = `div .t--schema-virtuoso-container`;
private _dsVirtuosoList = `[data-test-id="virtuoso-item-list"]`;
private _dsSchemaContainer = `[data-testId="datasource-schema-container"]`;
private _dsSchemaContainer = `[data-testid="datasource-schema-container"]`;
private _dsVirtuosoElementTable = (targetTableName: string) =>
`${this._dsSchemaEntityItem}[data-testid='t--entity-item-${targetTableName}']`;
private _dsPageTabListItem = (buttonText: string) =>
Expand Down
2 changes: 1 addition & 1 deletion app/client/cypress/support/Pages/PropertyPane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class PropertyPane {
"div.tab-view span:contains('" + type + "')";

_dropdownSelectType = ".t--open-dropdown-Select-type";
_selectorViewLabel = '[data-testId="selector-view-label"]';
_selectorViewLabel = '[data-testid="selector-view-label"]';
_textView = ".text-view";
_selectorView = ".selector-view";
_dropdownOptions =
Expand Down
2 changes: 1 addition & 1 deletion app/client/src/IDE/Components/ToolbarSettingsPopover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const ToolbarSettingsPopover = (props: Props) => {
<Popover onOpenChange={handleOpenChange} open={isOpen}>
<PopoverTrigger>
<ToggleButton
data-testId={props.dataTestId}
data-testid={props.dataTestId}
disabled={props.disabled}
icon="settings-2-line"
isSelected={isOpen}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const Section: React.FC<SectionProps> = ({
<div
className={classNames}
data-fullwidth={isFullWidth.toString()}
data-withoutPadding={withoutPadding.toString()}
data-withoutpadding={withoutPadding.toString()}
{...props}
>
{children}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@
max-width: 800px;
justify-content: center;

&[data-withoutPadding="true"] {
&[data-withoutpadding="true"] {
padding: 0;
}

/* We do not want padding above the first section */
&[data-withoutPadding="false"]:first-child {
&[data-withoutpadding="false"]:first-child {
padding-bottom: var(--ads-v2-spaces-6);
}

/* All other sections expect first will have padding top and bottom */
&[data-withoutPadding="false"]:not(:first-child) {
&[data-withoutpadding="false"]:not(:first-child) {
padding-block: var(--ads-v2-spaces-6);
}

/* We will also render a border below sections expect for the last section */
&[data-withoutPadding="false"]:not(:last-child) {
&[data-withoutpadding="false"]:not(:last-child) {
border-bottom: 1px solid var(--ads-v2-color-border);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ function BindDataButton(props: BindDataButtonProps) {
</MenuTrigger>
<MenuContent
align={"end"}
data-testId={"t--widget-selection"}
data-testid={"t--widget-selection"}
height={pages.length <= 4 ? "fit-content" : "186px"}
side={"top"}
width="235px"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const Schema = (props: Props) => {
overflow="hidden"
>
<Flex
data-testId="datasource-schema-container"
data-testid="datasource-schema-container"
flex="1"
flexDirection="column"
gap="spaces-3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export function LoadMoreOptions(props: LoadmoreProps) {
return (
<MenuItem>
<div
data-testId="t--one-click-binding-datasource--load-more"
data-testid="t--one-click-binding-datasource--load-more"
onMouseDown={(e) => {
e?.stopPropagation();
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function DatasourceDropdown() {
const onChange = useCallback((value: string) => setSearchText(value), []);

return (
<SelectWrapper data-testId="t--one-click-binding-datasource-selector">
<SelectWrapper data-testid="t--one-click-binding-datasource-selector">
<Menu
onOpenChange={(open: boolean) => {
setOpen(open);
Expand All @@ -110,7 +110,7 @@ function DatasourceDropdown() {
>
<MenuTrigger>
<StyledDropdownTrigger
data-testId="t--one-click-binding-datasource-trigger"
data-testid="t--one-click-binding-datasource-trigger"
isDisabled={disabled}
isValid={!error}
>
Expand All @@ -131,7 +131,7 @@ function DatasourceDropdown() {
<StyledInputContainer>
<SearchInput
autoFocus
data-testId="t--one-click-binding-datasource--search"
data-testid="t--one-click-binding-datasource--search"
onChange={onChange}
size="md"
// @ts-expect-error Fix this the next time the file is edited
Expand All @@ -141,7 +141,7 @@ function DatasourceDropdown() {
</StyledInputContainer>

{!!connectToOptions.length && (
<StyledMenuGroupName data-testId="t--one-click-binding-datasource-selector--bind-to-query">
<StyledMenuGroupName data-testid="t--one-click-binding-datasource-selector--bind-to-query">
<Text kind="heading-xs">{constants?.connectToText}</Text>
</StyledMenuGroupName>
)}
Expand All @@ -156,7 +156,7 @@ function DatasourceDropdown() {
.map((option) => {
return (
<MenuItem
data-testId="t--one-click-binding-datasource-selector--query"
data-testid="t--one-click-binding-datasource-selector--query"
key={option?.id}
onSelect={() => {
option?.onSelect(option?.value, option);
Expand Down Expand Up @@ -202,7 +202,7 @@ function DatasourceDropdown() {
.map((option) => {
return (
<MenuItem
data-testId="t--one-click-binding-datasource-selector--datasource"
data-testid="t--one-click-binding-datasource-selector--datasource"
key={option.id}
onSelect={() => {
option?.onSelect?.(option.value || "", option);
Expand Down Expand Up @@ -248,7 +248,7 @@ function DatasourceDropdown() {
{otherOptions.map((option: DropdownOptionType) => {
return (
<MenuItem
data-testId="t--one-click-binding-datasource-selector--other-action"
data-testid="t--one-click-binding-datasource-selector--other-action"
key={option.id}
onSelect={() => {
option.onSelect?.(option.value || "", option);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function TableOrSpreadsheetDropdown() {
{options.map((option) => {
return (
<Option
data-testId="t--one-click-binding-table-selector--table"
data-testid="t--one-click-binding-table-selector--table"
key={option.id}
value={option.value}
>
Expand All @@ -67,7 +67,7 @@ function TableOrSpreadsheetDropdown() {
);
})}
</Select>
<ErrorMessage data-testId="t--one-click-binding-table-selector--error">
<ErrorMessage data-testid="t--one-click-binding-table-selector--error">
{error}
</ErrorMessage>
</SelectWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function ConnectData({ btnText }: { btnText: string }) {
if (show) {
return (
<StyledButton
data-testId="t--one-click-binding-connect-data"
data-testid="t--one-click-binding-connect-data"
isDisabled={disabled}
isLoading={isLoading}
onClick={onClick}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default memo(function SheetsDropdown() {
<Label>{label}</Label>
</Tooltip>
<Select
data-testId="t--sheetName-dropdown"
data-testid="t--sheetName-dropdown"
dropdownStyle={{
minWidth: "350px",
maxHeight: "300px",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function ColumnDropdown(props: Props) {
<Label>{props.label}</Label>
<Select
allowClear
data-testId={`t--one-click-binding-column-${props.id}`}
data-testid={`t--one-click-binding-column-${props.id}`}
dropdownStyle={{
minWidth: "350px",
maxHeight: "300px",
Expand All @@ -56,7 +56,7 @@ function ColumnDropdown(props: Props) {
{options.map((option) => {
return (
<Option
data-testId={`t--one-click-binding-column-${props.id}--column`}
data-testid={`t--one-click-binding-column-${props.id}--column`}
key={option.id}
value={option.value}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export function useDropdown(props: OneClickDropdownFieldProps) {
if (options && options.length > 0) {
return (options as DropdownOptionType[])?.map((option) => (
<Option
data-testId={`t--one-click-binding-column-${props.id}--column`}
data-testid={`t--one-click-binding-column-${props.id}--column`}
key={option.id}
value={option.value}
>
Expand All @@ -186,7 +186,7 @@ export function useDropdown(props: OneClickDropdownFieldProps) {
} else {
return (
<Option
data-testId="t--one-click-binding-no-connectable-widget"
data-testid="t--one-click-binding-no-connectable-widget"
disabled
>
{createMessage(NO_CONNECTABLE_WIDGET_FOUND)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ function NewActionButton(props: NewActionButtonProps) {
</MenuTrigger>
<MenuContent
align={"end"}
data-testId={"t--page-selection"}
data-testid={"t--page-selection"}
height={pages.length <= 4 ? "fit-content" : "186px"}
side={"bottom"}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ const DatasourceViewModeSchema = (props: Props) => {

return (
<ViewModeSchemaContainer>
<DataWrapperContainer data-testId="datasource-schema-container">
<DataWrapperContainer data-testid="datasource-schema-container">
<StructureContainer>
{props.datasource && (
<DatasourceStructureHeader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ function GoogleSheetSchema(props: Props) {
return (
<ViewModeSchemaContainer>
<DataWrapperContainer>
<StructureContainer data-testId="datasource-schema-container">
<StructureContainer data-testid="datasource-schema-container">
{datasource && (
<DatasourceStructureHeader
datasource={datasource}
Expand Down
2 changes: 1 addition & 1 deletion app/client/src/pages/Editor/Explorer/Files/Submenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export function ExplorerMenuContent({
</div>
<SearchInput
autoFocus
data-testId="t--search-file-operation"
data-testid="t--search-file-operation"
onChange={onChange}
placeholder="Search datasources"
value={query}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ function ReconnectDatasourceModal() {
return (
<Modal open={isModalOpen}>
<ModalContentWrapper
data-testId="reconnect-datasource-modal"
data-testid="reconnect-datasource-modal"
onClick={handleClose}
onEscapeKeyDown={onClose}
onInteractOutside={handleClose}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const LoaderWrapper = styled.div`

function StatusLoader({ loaderMsg }: { loaderMsg: string }) {
return (
<LoaderWrapper data-testId="t--git-merge-loader">
<LoaderWrapper data-testid="t--git-merge-loader">
<SpinnerLoader size="md" />
<Text kind={"body-m"} style={{ marginLeft: 8 }}>
{loaderMsg}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const ApplicationSearchItem = (props: Props) => {
</Text>
{applicationsList.map((application: ApplicationPayload) => (
<SearchListItem
data-testId={application.name}
data-testid={application.name}
key={application.id}
onClick={() => navigateToApplication(application.id)}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const WorkspaceSearchItems = (props: Props) => {
</Text>
{workspacesList.map((workspace: Workspace) => (
<SearchListItem
data-testId={workspace.name}
data-testid={workspace.name}
key={workspace.id}
onClick={() => {
setIsDropdownOpen(false);
Expand Down

0 comments on commit 723332f

Please sign in to comment.