Skip to content

Commit

Permalink
[ui-doc] Documenting data-testid attribute in contributing-frontend.m…
Browse files Browse the repository at this point in the history
…d file (#3732)

* Documenting data-testid attribute in contributing-frontend.md file

* Removing the extra ts variable from the code text
  • Loading branch information
ananya-agarwal authored May 15, 2024
1 parent c6673f8 commit d5ab133
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions contributing-frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,26 @@ import { Pagination } from 'antd';
import PrimaryButton from 'cuix/dist/components/Button/PrimaryButton';
```

## Adding data-testid attribute

data-testid attributes are custom attributes that can be added to HTML elements to identify them for testing purposes. They are commonly used in testing frameworks and tools to locate and interact with elements on web pages.

Hue follows a pattern of
```
area--action--role
```
while adding data-testids

Example:
editor-coordinator--save-as--button , editor-sql-assist--refresh--button

In this manner, these data-testids can be added along with the other HTML attributes.

Example:
```
<i class="fa fa-chevron-left assist-breadcrumb-back" data-testid="assist-sql--databases-breadcrumb-back--button"></i>
```

## Styling

Hue uses `Sass` while both cuix and Ant Design use `Less` for writing CSS. The core cuix variables are however stil available in sass.
Expand Down

0 comments on commit d5ab133

Please sign in to comment.