[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 1 commit
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
4 changes: 3 additions & 1 deletion 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,6 +264,7 @@ describe('SEO: Font size audit', () => {
attributes: ['class', 'my-p'],
});

expect(auditResult.details.items[0].source).toBe('http://www.example.com');
expect(auditResult.details.items[0].selector).toMatchObject({
type: 'node',
selector: '#my-parent',
Expand All @@ -280,6 +281,7 @@ describe('SEO: Font size audit', () => {
attributes: ['size', '10px'],
});

expect(auditResult.details.items[0].source).toBe('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.

it's also funny because the whole reason I recommended toMatchObject in the first place was because you were asserting against .source and .selector separately 😆

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

expect(auditResult.details.items[0].selector).toMatchObject({
type: 'node',
selector: '#my-parent',
Expand Down