[go: nahoru, domu]

Skip to content

Commit

Permalink
tests(font-size): assert on source (#9413)
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark authored and paulirish committed Nov 6, 2019
1 parent d9bf4be commit 499730d
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions lighthouse-core/test/audits/seo/font-size-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,10 @@ describe('SEO: Font size audit', () => {
expect(auditResult.notApplicable).toBe(true);
});

describe('attributes source location', () => {
describe('attributes source of style', () => {
async function runFontSizeAuditWithSingleFailingStyle(style, nodeProperties) {
const artifacts = {
URL: {finalUrl: 'http://www.example.com'},
URL,
MetaElements: makeMetaElements(validViewport),
FontSize: {
analyzedFailingNodesData: [
Expand All @@ -264,10 +264,13 @@ describe('SEO: Font size audit', () => {
attributes: ['class', 'my-p'],
});

expect(auditResult.details.items[0].selector).toMatchObject({
type: 'node',
selector: '#my-parent',
snippet: '<p class="my-p">',
expect(auditResult.details.items[0]).toMatchObject({
source: URL.finalUrl,
selector: {
type: 'node',
selector: '#my-parent',
snippet: '<p class="my-p">',
},
});
});

Expand All @@ -280,10 +283,13 @@ describe('SEO: Font size audit', () => {
attributes: ['size', '10px'],
});

expect(auditResult.details.items[0].selector).toMatchObject({
type: 'node',
selector: '#my-parent',
snippet: '<font size="10px">',
expect(auditResult.details.items[0]).toMatchObject({
source: URL.finalUrl,
selector: {
type: 'node',
selector: '#my-parent',
snippet: '<font size="10px">',
},
});
});
});
Expand Down

0 comments on commit 499730d

Please sign in to comment.