influxdata / influxdata/giraffe

GeoWidget: data-testid for components

Open
#408 0 comments 0 reactions 1 assignee Claimed by @ivankudibal View on GitHub
kind/tech debt team/bonitoo
Dominant language
TypeScript
Stars
189
Forks
33
Avg merge
3d 15h
Merged PRs (30d)
4

Description

**Build**

Detected in PR 365 - Dubsky fork

```
commit 361b63bc55ac4989f17f03f33165d3070c7236b2
```

**Use Case**

When writing automated tests in cypress it will be easier to write test selectors if target elements have a `data-testid` attribute. Without them selectors need to be written with sometimes complex syntax using class values and other attributes, whose values are subject to change. This makes the tests brittle.

**Example**

Here I want to check the track endpoints which are all contained in the first `









...
```
After this I would like to check the tracks themselves. The selector `path.leaflet-ant-path` can be used, but this only gets the second `path` element of the `g` element, which means to get the first `path` element will require some additional processing. And it would be more desirable to get the 'g' or `svg` element in the first place, but these have either no or few additional identifying attributes.

Here a `[data-testid=geowidget-track]` on either the `svg` or `g` element, would be very useful.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.