== Steps to reproduce
1) Open up a new window in incognito mode (assuming you are using chrome)
2) Login to https://en.m.wikipedia.beta.wmflabs.org/wiki/Dog with AMC off
3) Click the "Desktop" link in the footer
* This also affects the history link, the talk button (not tab), and the add talk button since amc outreach was setup to work with those
== Expected results
- AMC Outreach drawer opens
== Actual results
- AMC Outreach drawer does not open. Nothing happens.
=== Check any additional observations
[x] Observed on the [[ https://en.m.wikipedia.beta.wmflabs.org/wiki/Dog | beta cluster wiki ]]
[] Observed on a [[ https://en.wikipedia.org/wiki/Barack_Obama | production wiki ]]
[] Observed on [[ https://en.wikipedia.org/wiki/Barack_Obama | Vector desktop skin ]]
[x] Observed on [[ https://en.m.wikipedia.org/wiki/Barack_Obama | MinervaNeue responsive skin ]]
[x] Observed while logged in
[] Observed while //not// logged in (anonymous)
== Dev Notes
* In https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/MobileFrontend/+/558256/ we made Drawers not append themselves to the body, but did not update AMC Outreach drawer to reflect this change.
* The change required is somewhat complicated because AmcOutreachDrawer is used in both MF and Minerva, but the drawers code to append a drawer to body lives in Minerva: https://github.com/wikimedia/mediawiki-skins-MinervaNeue/blob/master/resources/skins.minerva.scripts/drawers.js
* The simplest change will probably involve passing a hook to amcOutreach.js that can append the drawer and a hook that will register the events as done in:
- https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/MobileFrontend/+/563623
- https://gerrit.wikimedia.org/r/#/c/mediawiki/skins/MinervaNeue/+/563622
= QA steps (ready now)
This is now on the beta cluster and enables all logged in users with >= 0 edits to see the drawer (the # of edits is configurable and was set to 0 to make testing easier).
This is a bit of a pain to test multiple times because the drawer should only show once per browser/action/device combo. A way to get around this is to use a new incognito mode window in chrome (iOS Safari has their own version of that at https://support.apple.com/en-us/HT203036) every time you want to see the drawer:
1) If you have enabled AMC at https://en.m.wikipedia.beta.wmflabs.org, turn it off
2) Close all previous incognito windows, launch a new incognito window, and login to https://en.m.wikipedia.beta.wmflabs.org/wiki/Spain
Alternatively, if you are on a laptop on chrome, you can open up dev tools and in the console execute `localStorage.clear()`. This saves you from having to open/close tabs and log in/log out.
== When user is logged in with AMC turned off, user clicks desktop link, and then dismisses it
[] Follow steps 1 - 2 and assert you see the drawer when you click on "Desktop" link in the footer
[] Assert that the drawer remains visible when attempting to scroll.
[] Dismiss the drawer by tapping the "No thanks" link or by tapping the black part of the overlay. Assert that the desktop page loads.
[] Go back to the mobile site by clicking the "Mobile view" link in the footer. Click the desktop link in the footer again and assert that the drawer does NOT show but the desktop page loads. Click the mobile view link again to go back to the mobile site.
== When user is logged in with AMC turned off, user clicks desktop link, and then enables it
[] Follow steps 1 - 2 and assert you see the drawer when you click on "Desktop" link in the footer
[] Enable amc mode by tapping "Enable advanced mode" button. Assert that the page reloads. The desktop site should NOT load.
[] Click the desktop link in the footer again and assert that the drawer does NOT show but the desktop page loads. Click the mobile view link again to go back to the mobile site.
== When user is logged in with AMC turned off, user clicks history link, and then dismisses it
[] Follow steps 1 - 2 and assert you see the drawer when you click on "Last edited ...." link at bottom of page
[] Assert that the drawer remains visible when attempting to scroll.
[] Dismiss the drawer by tapping the "No thanks" link or by tapping the black part of the overlay. Assert that the non-amc history page loads.
[] Go back to previous page and click history link again. Assert that the drawer does NOT show but the history page loads again.
== When user is logged in with AMC turned off, user clicks history link, and then enables it
[] Follow steps 1 - 2 and assert you see the drawer when you click on "Last edited ...." link at bottom of page
[] Enable amc mode by tapping "Enable advanced mode" button. Assert that the amc history page loads
[] Go back to previous page and click history link again. Assert that the drawer does NOT show but the amc history page loads.