testing-library / testing-playground

Simple and complete DOM testing playground that encourage good testing practices.

Home Page:https://testing-playground.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

support custom `testid` in the Chrome Extension

smeijer opened this issue Β· comments

Summary πŸ’‘

The title says it all.

Motivation πŸ”¦

https://twitter.com/wescopeland_/status/1275800945331441668?s=20

Hey!
Could I maybe have an example of a custom testId that the Chrome extension should support?
Thanks!

Ok, I got it. Thank you very much!

I could give it a shot.
I have two question about the implementation:

  1. should we enable this feature in testing-playground too?
  2. if you have already thought about this: in order to retrieve the desired attribute to be used as testId should we add an input somewhere where the user could insert it?
  1. Yes, I think we should keep the web version and the chrome version as equal as possible. That way a user could just copy/paste code from his tests (debug output) to the web version, and share the link with others to get some advice.

  2. Yes, we would need an input. I have some idea's about the interface, but I haven't figured it out exactly. I think we need to add a settings modal similar to how react-devtools does it. The settings modal for the web version can follow later on, as long as the technical implementation (the id-attribute config) works on both.

    If we need a library for the modal, we can use https://reacttraining.com/reach-ui/dialog

Ok, I think I have understood.
If it sounds good to you, I could start adding a settings modal to the extension in which a user could insert the attribute to be used as custom test id.

Sounds great @delca85.

@delca85, I'm working on an interface update to support a setting modal. So don't worry too much about where you're going to place that input. Just focus on figuring out how we can configure testing-lib to apply that setting.

image

@smeijer, great! I have already implemented the functionality but I still have to apply style to the modal. If it's ok for you I could push tonight the code I have and later we could merge our work.

Sounds good to me @delca85

closed by #227