browser_dbg-react-app.js (1177B)
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 add_task(async function () { 8 await pushPref("devtools.debugger.map-scopes-enabled", true); 9 const dbg = await initDebugger("doc-react.html", "App.js"); 10 11 await selectSource(dbg, "App.js"); 12 await addBreakpoint(dbg, "App.js", 11); 13 14 info("Test previewing an immutable Map inside of a react component"); 15 invokeInTab("clickButton"); 16 await waitForPaused(dbg); 17 18 await waitForState(dbg, () => 19 dbg.selectors.getSelectedScopeMappings(dbg.selectors.getCurrentThread()) 20 ); 21 22 await assertPreviews(dbg, [ 23 { 24 line: 10, 25 column: 22, 26 expression: "fields", 27 fields: [["size", "1"]], 28 }, 29 ]); 30 31 info("Verify that the react file is flagged as a javascript module"); 32 const sourceTab = findElementWithSelector(dbg, ".source-tab.active"); 33 34 ok( 35 sourceTab.querySelector(".dbg-img-javascript.source-icon"), 36 "Source tab for a react file has a Javascript icon" 37 ); 38 assertSourceIcon(dbg, "App.js", "javascript"); 39 });