|
24 | 24 | define(function (require, exports, module) { |
25 | 25 |
|
26 | 26 |
|
27 | | - var SpecRunnerUtils = require("spec/SpecRunnerUtils"); |
| 27 | + const SpecRunnerUtils = require("spec/SpecRunnerUtils"), |
| 28 | + simple1_html = require("text!spec/LiveDevelopment-MultiBrowser-test-files/simple1.html"), |
| 29 | + test_php = require("text!spec/LiveDevelopment-MultiBrowser-test-files/htmlOther/test.php"); |
28 | 30 |
|
29 | 31 | describe("integration:HTML Lint", function () { |
30 | 32 | let testProjectsFolder, |
31 | | - Strings = require("strings"), |
32 | 33 | testWindow, |
33 | 34 | $, |
34 | 35 | CodeInspection, |
@@ -177,5 +178,22 @@ define(function (require, exports, module) { |
177 | 178 | await SpecRunnerUtils.deletePathAsync(invalidNameJSON, true, FileSystem); |
178 | 179 | await SpecRunnerUtils.deletePathAsync(validNameJSON, true, FileSystem); |
179 | 180 | }, 6000); |
| 181 | + |
| 182 | + const testExtensions = [".htm", ".xhtml", ".jsp", ".asp", ".aspx", ".php"]; |
| 183 | + for(let testExtension of testExtensions) { |
| 184 | + // eslint-disable-next-line no-loop-func |
| 185 | + it(`should show html lint error in ${testExtension} files`, async function () { |
| 186 | + const testFile = "test_"+testExtension; |
| 187 | + const content = testExtension === ".php" ? simple1_html : test_php; |
| 188 | + await jsPromise(SpecRunnerUtils.createTextFile(testProjectsFolder + testFile, content, FileSystem)); |
| 189 | + |
| 190 | + await awaitsFor(async ()=>{ |
| 191 | + await _siwtchFilesTo(testFile); |
| 192 | + return $("#problems-panel").is(":visible") && $("#problems-panel").text().includes( |
| 193 | + "<html> is missing required \"lang\" attribute (element-required-attributes)"); |
| 194 | + }, "html lint error for "+testFile); |
| 195 | + await SpecRunnerUtils.deletePathAsync(testProjectsFolder + testFile, true, FileSystem); |
| 196 | + }, 5000); |
| 197 | + } |
180 | 198 | }); |
181 | 199 | }); |
0 commit comments