mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-03-01 14:51:04 -05:00
In research I’ve sometimes seen people click the wrong nav item. I reckon that people’s concept of which pages live behind which navigation items isn’t very strong. We can reinforce this relationship by showing, for every page, which is the corresponding nav item. The conventional way of doing this is either with some kind of emphasis, typically colour or bold. I’ve gone for bold because colour would be weird. --- The implementation of this is quite loosely coupled to our application code because: - our application code is not well structured (eg we don’t make any use of blueprints) - spreading this change across lots of files in our application would make it harder to test without actually hitting each endpoints; such tests would be slow and verbose So I’ve gone for more of a meta approach. Rather than testing that each endpoint has a specific navigation item selected, I’ve gone for validating that: - all endpoints being mapped to are real - all endpoints have _a_ selected navigation item (or are specifically excluded) This means that it’s impossible to add, change or remove an endpoint without also updating which navigation item should be selected. And the actual mapping is so declarative that it testing it would be redundant.