testing-library / testing-playground

Simple and complete DOM testing playground that encourage good testing practices.
https://testing-playground.com
MIT License
788 stars 62 forks source link

fix: don't use localStorage when browser blocks access #287

Closed marcosvega91 closed 4 years ago

marcosvega91 commented 4 years ago

fix #284

What:

Fix an issue when the user has disabled the use of cookies

Why:

It was an issue

How:

Before using localStorage I have check that cookies are enabled. If cookies are disabled user settings will be reset on page refresh.

I have also added a warning on the settings

image

Checklist:

smeijer commented 4 years ago

Thanks! The issue also mentions:

and display an error message informing the user to enable third-party cookies if required

I think it would indeed be nice to show a message in the settings dialog if localStorage is disabled. Otherwise the user might not understand why their test-id attribute isn't saved.

marcosvega91 commented 4 years ago

I have added this warning

image

smeijer commented 4 years ago

Thanks, Marco!