DEV: Add checks that assets do not modify cookies to smoke-test.js (PR #9504)

Test cases as a followup from a past postmortem related to nginx configs.

This test will fail when executed against a Rails server without the container’s nginx (or an improperly configured nginx) in front of it that blocks the application from setting cookies on cached asset requests.

Haven’t figured out how to build discourse_test locally, so I’m throwing this against CI.


I would change the name of this test to something like “application paths do set cookies”, otherwise the reverse logic might be confusing to see here.

The idea to grab old cookie, set bogus cookies, visit path, compare new cookies, restore old cookies is awesome! :raised_hands:

Most of my concerns here is just to make naming/comments adjustments so it’s easier to reason through the logic here later on, but it looks great!

Might be good to update the comment here a little more explicitly say that it passes because we expect checkNoCookies to fail+throw; this may be difficult to reason about/read through later down the road otherwise.

Test failure is a flake.