From 56411e2633e4b0e35e5f5a176062a4023ee2834a Mon Sep 17 00:00:00 2001 From: Gaming4JC Date: Sun, 9 Jun 2019 23:13:13 -0400 Subject: [PATCH] 104442 - Part 5: Add another testcase for devtools and note. --- .../test/components/page-error.test.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git 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 index 82ee850110..5bc5fe0f0d 100644 --- 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 @@ -219,4 +219,22 @@ describe("PageError component:", () => { 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"); + }); });