@@ -78,12 +78,10 @@ describe(`web worker CSS Language tests`, async function () {
7878 * // todo these tests
7979 * - "compatibleVendorPrefixes": Unnecessary vendor prefixes checker.
8080 * - "vendorPrefix": Warns on missing vendor prefixes.
81- * - "boxModel": Warns if CSS box model is potentially misused.
8281 * - "universalSelector": Warns against the use of the universal selector (*).
8382 * - "fontFaceProperties": Ensures necessary properties are included in @font-face declarations.
8483 * - "hexColorLength": Enforces consistency in hex color definitions.
8584 * - "argumentsInColorFunction": Validates arguments within color functions.
86- * - "unknownProperties": Warns on unrecognized or mistyped CSS properties.
8785 * - "ieHack": Warns about CSS hacks for older versions of Internet Explorer.
8886 * - "unknownVendorSpecificProperties": Flags vendor-specific properties that might not be universally recognized.
8987 * - "propertyIgnoredDueToDisplay": Notifies when CSS properties are ignored due to the `display` setting of an element.
@@ -97,11 +95,41 @@ describe(`web worker CSS Language tests`, async function () {
9795 * duplicateProperties: "warning"
9896 * zeroUnits: "warning"
9997 * emptyRules: "warning"
98+ * unknownProperties: "warning"
10099 * // leave default
101100 * importStatement: none
102101 * boxModel: none
103102 */
104103
104+ it ( "should validate css unknownProperties" , async function ( ) {
105+ const cssValidationData = await ( await fetch ( "test-files/cssValidationData.json" ) ) . json ( ) ;
106+ messageFromWorker = null ;
107+ const text = `.box {
108+ doesntExist: 300px;
109+ }` ;
110+ worker . postMessage ( {
111+ command : `validateCSS` , text, cssMode : "CSS" , filePath : "file:///c.css" , lintSettings : {
112+ unknownProperties : "warning"
113+ }
114+ } ) ;
115+ let output = await waitForWorkerMessage ( `validateCSS` , 1000 ) ;
116+ const symbols = output . diag ;
117+ expect ( symbols ) . to . deep . equal ( cssValidationData [ "unknownProperties" ] ) ;
118+ } ) ;
119+
120+ it ( "should validate css unknownProperties by default" , async function ( ) {
121+ const cssValidationData = await ( await fetch ( "test-files/cssValidationData.json" ) ) . json ( ) ;
122+ messageFromWorker = null ;
123+ const text = `.box {
124+ doesntExist: 300px;
125+ }` ;
126+ worker . postMessage ( {
127+ command : `validateCSS` , text, cssMode : "CSS" , filePath : "file:///c.css" } ) ;
128+ let output = await waitForWorkerMessage ( `validateCSS` , 1000 ) ;
129+ const symbols = output . diag ;
130+ expect ( symbols ) . to . deep . equal ( cssValidationData [ "unknownProperties" ] ) ;
131+ } ) ;
132+
105133 it ( "should validate css boxModel" , async function ( ) {
106134 const cssValidationData = await ( await fetch ( "test-files/cssValidationData.json" ) ) . json ( ) ;
107135 messageFromWorker = null ;
0 commit comments