Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ebidel committed Apr 13, 2017
1 parent 6c1a4b4 commit f6b5a72
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lighthouse-core/test/report/v2/renderer/report-renderer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe('ReportRenderer V2', () => {
});
});

describe('renderReport', () => {
describe.only('renderReport', () => {
it('should render a report', () => {
const container = renderer._dom._document.body;
const output = renderer.renderReport(sampleResults, container);
Expand All @@ -88,6 +88,14 @@ describe('ReportRenderer V2', () => {
assert.ok(container.querySelector('.lh-header'), 'report has header');
});

it('renders additional reports by replacing the existing one', () => {
const container = renderer._dom._document.body;
const oldReport = renderer.renderReport(sampleResults, container);
const newReport = renderer.renderReport(sampleResults, container);
assert.ok(!container.contains(oldReport), 'old report was removed');
assert.ok(container.contains(newReport), 'new report appended to container');
});

it('should render an exception for invalid input', () => {
const container = renderer._dom._document.body;
const output = renderer.renderReport({
Expand Down

0 comments on commit f6b5a72

Please sign in to comment.