Skip to content

Commit bd16971

Browse files
committed
chore: integration tests for external style sheets
1 parent d6825a0 commit bd16971

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

src/extensions/default/HTMLCodeHints/integ-tests.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,14 @@ define(function (require, exports, module) {
286286
await _validateCssEdit("cssLive1.scss");
287287
});
288288

289+
it("should get external https css style sheet", async function () {
290+
await openFile("htmlOther/externalStyle.html", true);
291+
await awaitsFor(async function () {
292+
const allSelectors = await CSSUtils.getAllCssSelectorsInProject();
293+
return allSelectors.includes(".devicon-aarch64-original-wordmark");
294+
}, "external style sheet hints to be loaded");
295+
});
296+
289297
async function _testCssClassHintInFile(htmlLikeFile) {
290298
await openFile(htmlLikeFile, true);
291299
await openFile("cssLive.css", true);

src/language/CSSUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1954,7 +1954,7 @@ define(function (require, exports, module) {
19541954
cacheInProgress.delete(link);
19551955
}
19561956

1957-
const MAX_ALLOWED_EXTERNAL_STYLE_SHEETS = 20;
1957+
const MAX_ALLOWED_EXTERNAL_STYLE_SHEETS = 30;
19581958

19591959
/**
19601960
* html files may have embedded link style sheets to external CDN urls. We will parse them to get all selectors.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>inline styles test</title>
6+
<link rel="stylesheet" type="text/css"
7+
href="https://cdn.jsdelivr.net/gh/devicons/devicon@latest/devicon.min.css" />
8+
<style>
9+
.integratedStyle {
10+
color: blue;
11+
}
12+
</style>
13+
</head>
14+
<body>
15+
<div class="integratedStyle">
16+
this file has integrated html styles
17+
</div>
18+
</body>
19+
</html>

0 commit comments

Comments
 (0)