Currently, our tests simulate a preference save for one set of defaults. We don't run tests that see how those preferences respond to changes in defaults. The absence of this kind of test contributed to T300757.
Currently, if a preference is not defined, the site default is used.
For example, for the skin preference, if the default skin for that wiki is changed from "Vector" to "vector-2022" and the user has not changed skin, they will suddenly get vector-2022.
When rolling out the new Vector experience, for certain wikis we want to keep existing users in the old experience, and only opt-in users for newly created accounts.
We used to have this behaviour with the old skin version code (To be confirmed) but lost it when splitting Vector into 2 skins.
We should add tests that save preferences under a set of defaults, then check the preferences after the defaults have changed. See examples.
Acceptance criteria
- Consider adding a core preference e.g. wgDefaultSkinLoggedInUsers
- Write the tests first
- Fix the code.
Integration tests to be added
Note, the existing configuration VectorDefaultSkinVersionForExistingAccounts is really about whether to change the existing skin for users when we change the default skin.
Test 1 (enabling a pilot wiki, but leaving Vector 2022 users alone)
- The configuration of the site is default skin = Vector; default skin for existing users = Vector
- Save a preference setting skin to Vector 2022.
- Update configuration of the site to set the default skin to Vector 2022, and existing users = Vector
- Check the skin of the user is still Vector 2022.
Test 2 (enabling a pilot wiki, but leaving logged in users skin alone)
- The configuration of the site is default skin = Vector; default skin for existing users = Vector
- Save a preference setting skin to Vector.
- Update configuration of the site to set the default skin to Vector 2022, and existing users = Vector
- Check the existing skin is Vector.
Test 3 (auto-opting in logged in users on a pilot wiki)
- The configuration of the site is default skin = Vector; default skin for existing users = Vector
- Save a preference setting skin to Vector
- Update configuration of the site to set the default skin to Vector 2022, and existing users = Vector 2022
- Check the existing skin is now Vector 2022.
Test 4 (rolling back a pilot wiki deploymement)
- The configuration of the site is default skin = Vector 2022; default skin for existing users = Vector2022
- Save a preference setting skin to Vector 2022.
- Update configuration of the site to set the default skin to Vector, and existing users = Vector
- Check the existing skin is Vector.