[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests(font-size): assert on source #9413

Merged
merged 4 commits into from
Jul 23, 2019
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions lighthouse-core/test/audits/seo/font-size-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ describe('SEO: Font size audit', () => {
expect(auditResult.notApplicable).toBe(true);
});

describe('attributes source location', () => {
describe('attributes style source', () => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

attributes style source are all nouns so.... wb attributes source of style ? still all nouns but BAM a preposition too

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha love it!

async function runFontSizeAuditWithSingleFailingStyle(style, nodeProperties) {
const artifacts = {
URL: {finalUrl: 'http://www.example.com'},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reuse URL?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

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