Bug 1306727 - New console frontend: Add test for the location in consoleApiCall. r=linclark
authorNicolas Chevobbe <chevobbe.nicolas@gmail.com>
Sun, 02 Oct 2016 15:16:49 -0700
changeset 359156 cf5c96ed4ae6d6d6968a5e1bf4f97a2bb070500a
parent 359155 d94f92d3dc02d8c3094ef55621393f56de56a204
child 359157 4a08689beee88bc554f0b26ebb1b89a6fec85985
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-beta@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslinclark
bugs1306727
milestone52.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1306727 - New console frontend: Add test for the location in consoleApiCall. r=linclark MozReview-Commit-ID: H3eLp8FDQRN
devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js
--- a/devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js
+++ b/devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js
@@ -22,16 +22,21 @@ describe("ConsoleAPICall component:", ()
   describe("console.log", () => {
     it("renders string grips", () => {
       const message = stubPreparedMessages.get("console.log('foobar', 'test')");
       const wrapper = render(ConsoleApiCall({ message, onViewSourceInDebugger }));
 
       expect(wrapper.find(".message-body").text()).toBe("foobar test");
       expect(wrapper.find(".objectBox-string").length).toBe(2);
       expect(wrapper.find("div.message.cm-s-mozilla span span.message-flex-body span.message-body.devtools-monospace").length).toBe(1);
+
+      // There should be the location
+      const locationLink = wrapper.find(`.message-location`);
+      expect(locationLink.length).toBe(1);
+      expect(locationLink.text()).toBe("test-tempfile.js:1:27");
     });
 
     it("renders repeat node", () => {
       const message =
         stubPreparedMessages.get("console.log('foobar', 'test')")
         .set("repeat", 107);
       const wrapper = render(ConsoleApiCall({ message, onViewSourceInDebugger }));