Skip to content

Commit

Permalink
Fix: Some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sarvaje committed Feb 26, 2019
1 parent 19f6a8e commit dccd05e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/hint-no-broken-links/src/hint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default class NoBrokenLinksHint implements IHint {
};

const isDNSOnlyResourceHint = (element: HTMLElement): boolean => {
if (element.nodeName !== 'LINK') {
if (element.nodeName.toLowerCase() !== 'link') {
return false;
}

Expand Down
6 changes: 3 additions & 3 deletions packages/hint-no-protocol-relative-urls/tests/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const tests: HintTest[] = [
name: `'link' with initial // fails the hint`,
reports: [{
message: generateErrorMessage('//site.webmanifest'),
position: { column: 37, line: 1 }
position: { column: 9, line: 2 }
}],
serverConfig: generateHTMLPage('<link rel="manifest" href="//site.webmanifest">')
},
Expand All @@ -46,7 +46,7 @@ const tests: HintTest[] = [
name: `'script' with initial // fails the hint`,
reports: [{
message: generateErrorMessage('//script.js'),
position: { column: 23, line: 4 }
position: { column: 9, line: 5 }
}],
serverConfig: generateHTMLPage(undefined, '<script src="//script.js"></script>')
},
Expand All @@ -66,7 +66,7 @@ const tests: HintTest[] = [
name: `'a' with initial // fails the hint`,
reports: [{
message: generateErrorMessage('//home'),
position: { column: 19, line: 4 }
position: { column: 9, line: 5 }
}],
serverConfig: generateHTMLPage(undefined, '<a href="//home">home</a>')
},
Expand Down
1 change: 1 addition & 0 deletions packages/hint/src/lib/types/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export class HTMLElement {

public constructor(element: ParsedHTMLElement | HTMLElement, ownerDocument?: HTMLDocument) {
this._element = element instanceof HTMLElement ? element._element : element;
this.ownerDocument = ownerDocument;
}

public get attributes(): INamedNodeMap {
Expand Down

0 comments on commit dccd05e

Please sign in to comment.