browser_944887_destroyWidget_should_destroy_in_palette.js (783B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 "use strict"; 6 7 const kWidgetId = "test-destroy-in-palette"; 8 9 // Check destroyWidget destroys the node if it's in the palette 10 add_task(async function () { 11 CustomizableUI.createWidget({ 12 id: kWidgetId, 13 label: "Test destroying widgets in palette.", 14 }); 15 await startCustomizing(); 16 await endCustomizing(); 17 ok( 18 gNavToolbox.palette.querySelector("#" + kWidgetId), 19 "Widget still exists in palette." 20 ); 21 CustomizableUI.destroyWidget(kWidgetId); 22 ok( 23 !gNavToolbox.palette.querySelector("#" + kWidgetId), 24 "Widget no longer exists in palette." 25 ); 26 });