Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing Playground breaks Miro #351

Open
chodorowicz opened this issue Sep 23, 2022 · 2 comments
Open

Testing Playground breaks Miro #351

chodorowicz opened this issue Sep 23, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@chodorowicz
Copy link

Bug Report 🐛

Testing Playground breaks Miro

Cannot read properties of undefined (reading 'startAppLoadingStep')

https://community.miro.com/ask-the-community-45/miro-broken-when-used-with-testing-library-extension-9916

CleanShot 2022-09-23 at 09 55 49

To Reproduce ✔️

  1. Install Testing Playground Extension
  2. Access Miro Board

Expected behavior 🤔

Miro should load correctly.

Suggested solution 🔦

Setting the extension to load on click fixes the problem.

Your Environment 💻

  • browser: Chrome
  • os: Mac
@chodorowicz chodorowicz added the bug Something isn't working label Sep 23, 2022
@smeijer
Copy link
Member

smeijer commented Sep 26, 2022

It must be one of the patched methods on window that's causing issues. I'm happy to accept a pull that makes it safer by namespacing or even adding it behind an init function. Something like window.initTestingLibrary();

export function setup(view) {
// monkey patch `screen` to add testing library to console
for (const prop of Object.keys(screen)) {
view.screen[prop] = view.screen[prop] || augmentQuery(screen[prop]);
view[prop] = view.screen[prop];
}
view.getRoles = getRoles;
view.fireEvent = fireEvent;
view.getSuggestedQuery = getSuggestedQuery;
view.within = within;
view.container = view.document.body;
view.userEvent = userEvent;
view.user = userEvent;
}

@sersorrel
Copy link

It's not that; I commented out the entire setup function and it's still broken.

The issue occurs when testing-library.js is injected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants