Skip to content

Commit 96bde21

Browse files
authored
Fix CSS test on base property definitions (#1273)
The test did not take into account the possibility that the base definition of a CSS property could be in a delta spec. That's currently the case for the `continue` property: defined in `css-overflow-4`, extended in `css-overflow-5`. Not done here but the test could also be extended to make sure that the base definition is defined in a delta spec that is logically *before* the spec that extends the definition. The use of a separate array is meant to ease that further update. Closes #1272.
1 parent 46580e1 commit 96bde21

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/css/all.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ describe(`The curated view of CSS extracts`, () => {
2929
before(async () => {
3030
const all = await css.listAll({ folder: curatedFolder });
3131
const baseProperties = {};
32+
const basePropertiesInDeltaSpecs = {};
3233
const extendedProperties = {};
3334
const selectors = {};
3435
const valuespaces = {};
@@ -51,6 +52,12 @@ describe(`The curated view of CSS extracts`, () => {
5152
}
5253
baseProperties[name].push({ spec: data.spec, dfn: desc });
5354
}
55+
else if ((type === 'property') && (spec.seriesComposition === 'delta') && !desc.newValues) {
56+
if (!basePropertiesInDeltaSpecs[name]) {
57+
basePropertiesInDeltaSpecs[name] = [];
58+
}
59+
basePropertiesInDeltaSpecs[name].push({ spec: data.spec, dfn: desc });
60+
}
5461
else if ((type === 'extended property') && desc[value]) {
5562
if (!extendedProperties[name]) {
5663
extendedProperties[name] = [];
@@ -154,7 +161,7 @@ describe(`The curated view of CSS extracts`, () => {
154161
describe(`Looking at extended CSS properties, the curated view`, () => {
155162
for (const [name, dfns] of Object.entries(extendedProperties)) {
156163
it(`contains a base definition for the "${name}" property`, () => {
157-
assert(baseProperties[name], 'no base definition found');
164+
assert(baseProperties[name] || basePropertiesInDeltaSpecs[name], 'no base definition found');
158165
});
159166
}
160167
});

0 commit comments

Comments
 (0)