Skip to content

Commit 8b90198

Browse files
committed
test: css class hints php, html, xhtml test
1 parent d0471d2 commit 8b90198

File tree

4 files changed

+70
-3
lines changed

4 files changed

+70
-3
lines changed

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

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

289-
it("should be able to add the class name by selecting the code hint", async function () {
290-
await openFile("inlineStyle.html", true);
289+
async function _testCssClassHintInFile(htmlLikeFile) {
290+
await openFile(htmlLikeFile, true);
291291
await openFile("cssLive.css", true);
292292
// this prefix is aaa as we need it as the top code hint
293293
const cssClassName = StringUtils.randomString(5, "aaaaaaaaaaa");
294294
setText({ line: 0, ch: 0 }, `.${cssClassName}{}\n`);
295295

296-
await openFile("inlineStyle.html", true);
296+
await openFile(htmlLikeFile, true);
297297
setText({ line: 12, ch: 31 }, ` `);
298298
await _validateCodeHints({ line: 12, ch: 32 }, [cssClassName], 0);
299299
expect(EditorManager.getActiveEditor().getToken().string).toBe(`"integratedStyle ${cssClassName}"`);
300300
await closeSession();
301+
}
302+
303+
it("should be able to add the class name by selecting the code hint in HTML file", async function () {
304+
await _testCssClassHintInFile("inlineStyle.html");
305+
});
306+
307+
it("should be able to add the class name by selecting the code hint in HTM file", async function () {
308+
await _testCssClassHintInFile("inlineStyle.htm");
309+
});
310+
311+
it("should be able to add the class name by selecting the code hint in XHTML file", async function () {
312+
await _testCssClassHintInFile("inlineStyle.xhtml");
313+
});
314+
315+
it("should be able to add the class name by selecting the code hint in PHP file", async function () {
316+
await _testCssClassHintInFile("inlineStyle.php");
301317
});
302318
});
303319
});
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>inline styles test</title>
6+
<style>
7+
.integratedStyle {
8+
color: blue;
9+
}
10+
</style>
11+
</head>
12+
<body>
13+
<div class="integratedStyle">
14+
this file has integrated html styles
15+
</div>
16+
</body>
17+
</html>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>inline styles test</title>
6+
<style>
7+
.integratedStyle {
8+
color: blue;
9+
}
10+
</style>
11+
</head>
12+
<body>
13+
<div class="integratedStyle">
14+
this file has integrated html styles
15+
</div>
16+
</body>
17+
</html>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8"/>
5+
<title>inline styles test</title>
6+
<style>
7+
.integratedStyle {
8+
color: blue;
9+
}
10+
</style>
11+
</head>
12+
<body>
13+
<div class="integratedStyle">
14+
this file has integrated html styles
15+
</div>
16+
</body>
17+
</html>

0 commit comments

Comments
 (0)