Skip to content

Commit

Permalink
Fix *-sort-key sdk support table
Browse files Browse the repository at this point in the history
  • Loading branch information
Asheem Mamoowala committed Dec 12, 2019
1 parent 0a98b3f commit 49f56dd
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/style-spec/reference/v8.json
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,12 @@
"type": "number",
"doc": "Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.",
"sdk-support": {
"basic functionality": {
"js": "1.2.0"
},
"data-driven styling": {
"js": "1.2.0"
}
},
"expression": {
"interpolated": false,
Expand Down Expand Up @@ -683,7 +688,12 @@
"type": "number",
"doc": "Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.",
"sdk-support": {
"basic functionality": {
"js": "1.2.0"
},
"data-driven styling": {
"js": "1.2.0"
}
},
"expression": {
"interpolated": false,
Expand Down Expand Up @@ -892,7 +902,12 @@
"type": "number",
"doc": "Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.",
"sdk-support": {
"basic functionality": {
"js": "1.2.0"
},
"data-driven styling": {
"js": "1.2.0"
}
},
"expression": {
"interpolated": false,
Expand Down
11 changes: 11 additions & 0 deletions test/unit/style-spec/spec.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,24 @@ test(`v8 Spec SDK Support section`, (t) => {
const propKeys = Object.keys(props);
propKeys.forEach((key) => {
t.ok(props[key]["sdk-support"], `${objKey}_${key} is missing sdk support section`);
if (props[key]["sdk-support"]) {
t.ok(props[key]["sdk-support"]["basic functionality"], `${objKey}_${key} is missing sdk support section for 'basic functionality'`);
if (props[key]["property-type"].includes("constant")) {
t.notOk(props[key]["sdk-support"]["data-driven styling"], `${objKey}_${key} should not have sdk support section for 'data-driven styling'`);
} else {
t.ok(props[key]["sdk-support"]["data-driven styling"], `${objKey}_${key} is missing sdk support section for 'data-driven styling'`);
}
}
});
});

const expressions = spec[v].expression_name.values;
const expressionNames = Object.keys(expressions);
expressionNames.forEach((expr) => {
t.ok(expressions[expr]["sdk-support"], `expression_${expr} is missing sdk support section`);
if (expressions[expr]["sdk-support"]) {
t.ok(expressions[expr]["sdk-support"]["basic functionality"], `expression_${expr} is missing sdk support section for 'basic functionality'`);
}
});
t.end();
});
Expand Down

0 comments on commit 49f56dd

Please sign in to comment.