DEV: Add more keyboard shortcut acceptance tests (PR #13280)

This adds acceptance tests for keyboard shortcuts to dismiss new and unread topics.

Also, I cleaned out a few old specs for the unit test for keyboard-shortcuts. Some were introduced way back in

but then supplanted by

and never cleaned up, so they were doing nothing.

Follow up to FIX: Dismiss topics keyboard shortcut not working (PR #13260) - #4 by SamSaffron

GitHub

Looks good, but I’m wondering if the fixture mutated is mutated for this test case only or is it carried over to the tests that run after this one?

Hmmm that is a very good point, let me run it with another test using the same DiscoveryFixture and see

Don’t we have to reset this after every test run? :thinking:

Ah you’re right that is a goof, forgot that these acceptance blocks are like the definitions of the test, will change

Instead of hardcoding the strings, can we use the translation helpers so that editing the translation in the future wouldn’t break this test.

Hmm I’m curious here, why do we have to remove an element from the DOM?

So the logic is that the top button only shows up if the bottom button is off the screen when the topics load. So this is a shortcut to avoid having to reload the unread.json list with a shorter list of topics. I can do that though if you think it’s too hacky?

Yea I think it’ll be better than altering the DOM in the test suite :slight_smile:

Oo this didn’t cause any problems with the tests you added because each test asserts against one of the two variables only.

You were right @OsamaSayegh this modified state, changed to clone the fixture first before modifying it

Feel free to merge after your changes :slight_smile:

Oh well, still made it neater anyway!