Right now setting a switch to global and deleting a switch both trigger a JS alert to appear. Not only is using modal alerts bad UI, it's also problematic for functional testing in a headless browser. Replace them with more elegant, testable solutions.