Consider setting `location.href` in a shared `beforeEach`

Description

So that the state of an individual FE test doesn't leak into other tests (within the same file), should we set a global beforeEach to initialize setWindowLocation? Otherwise, an individual test which set something like setWindowLocation('?foo=bar') would leave this global state around for every test that runs after it.

Context

Address this comment:

This just makes sure that tests which do not set the location get a consistent location, unaffected by other tests. ... question: Is this something we want to set in test_setup? 🤔

Prior art

We already have some helpers that automate setup and teardown that we could take inspiration from:

  • useMockLocationHelper
  • useLocalStorageSpy
Edited Jul 27, 2021 by Mark Florian
Assignee Loading
Time tracking Loading