influxdata / influxdata/clockface

Some newer elements are missing the attribute data-testid

Open
#699 0 comments 0 reactions 0 assignees View on GitHub
Medium Priority tech debt
Dominant language
TypeScript
Stars
46
Forks
18
Avg merge
2d 7h
Merged PRs (30d)
1

Description

**Describe the bug**

This is a bug for writing automated tests against applications using clockface. There is a well established idiom of using the attribute `data-testid` to locate elements to be manipulated during automated testing. When looking to click through the new compressed navbar to open alerts-history, I discovered that the element ` ` has no `data-testid`. With the word 'trigger' in the class name this is an obvious candidate element for automated testing paths. Furthermore this button is covering the anchor element which does have a `data-testid` attribute, but which does not now trigger the sub menu animation.

**To Reproduce**
Steps to reproduce the behavior:
1. Open influxdata ui
2. Open developer tools console
3. Inspect the bell icon in the navbar
4. The button element contains no `data-testid` attribute

**Expected behavior**
When writing automated tests, I expect to find `data-testid` attributes, especially in elements that are targets for user activity. Data-testids, which should not be liable to change, make automated tests more stable.

**Currently rendered HTML**

```HTML


```


**Screenshots**
If applicable, add screenshots to help explain your problem.
![ShowSubMenuButton01](https://user-images.githubusercontent.com/25881301/140523048-fe98f71d-a88e-4dd3-a2c6-50a9d4ba30fb.png)

**Browser**
- OS: Ubuntu 20.04
- Browser Chrome
- Version 95

Contributor guide

Open the contributing guide

Research direction

Start by locating the component that renders the cf-tree-nav--sub-menu-trigger button and inspect how its neighboring navigation elements receive data-testid attributes. Add a stable test identifier to the user-activated button, then verify that the rendered compressed navbar exposes it for automated tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend, testing
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.