Bug 104442 - Part 5: Add another testcase for devtools and note. r=nchevobbe
authorTooru Fujisawa <arai_a@mac.com>
Sat, 25 Feb 2017 12:52:34 +0900
changeset 489646 01bd2d505daa10f606a06ed6103ddcb9c1df0ebf
parent 489645 12c83a596d7b21cda79ee07c0d196139b5ddff3c
child 489647 4c67f9e2c412af99c07874b1ffa9e10dd62b613a
push id46871
push userbmo:sledru@mozilla.com
push dateSat, 25 Feb 2017 12:16:21 +0000
reviewersnchevobbe
bugs104442
milestone54.0a1
Bug 104442 - Part 5: Add another testcase for devtools and note. r=nchevobbe
devtools/client/webconsole/new-console-output/test/components/page-error.test.js
--- a/devtools/client/webconsole/new-console-output/test/components/page-error.test.js
+++ b/devtools/client/webconsole/new-console-output/test/components/page-error.test.js
@@ -218,9 +218,27 @@ describe("PageError component:", () => {
     const note3 = notes.eq(2);
     expect(note3.find(".message-body").text())
       .toBe("note: test note 3");
 
     const locationLink3 = note3.find(`.message-location`);
     expect(locationLink3.length).toBe(1);
     expect(locationLink3.text()).toBe("test3.js:9:4");
   });
+
+  it("displays error notes", () => {
+    const message = stubPreparedMessages.get("SyntaxError: redeclaration of let a");
+
+    let wrapper = render(PageError({ message, serviceContainer }));
+
+    const notes = wrapper.find(".error-note");
+    expect(notes.length).toBe(1);
+
+    const note = notes.eq(0);
+    expect(note.find(".message-body").text())
+      .toBe("note: Previously declared at line 2, column 6");
+
+    // There should be the location.
+    const locationLink = note.find(`.message-location`);
+    expect(locationLink.length).toBe(1);
+    expect(locationLink.text()).toBe("test-console-api.html:2:6");
+  });
 });