Add data-disabled to test fixtures

Summary:
This can be marked in fixtures to skip a test without commenting it out. We add one more usage of this.

The same functionality existed (unused) before for `experiments`, which I changed to `data-experiments`.

Formatting of JS tests changed to be closer to what Prettier would output, and to remove usage of `Yoga.UNDEFINED` which doesn't existi and just resolves to `undefined` (this is converted to NaN by the wrapper layer).

Differential Revision: D45723003

fbshipit-source-id: c014e1695d90fcb44d62f6a636ddbb0d86ec6eff
This commit is contained in:
Nick Gerleman
2023-05-10 21:10:46 -07:00
committed by Facebook GitHub Bot
parent e409bfb43a
commit 6f91133089
52 changed files with 1846 additions and 1101 deletions

View File

@@ -68,7 +68,11 @@ function printTest(e, ext, LTRContainer, RTLContainer, genericContainer) {
for (var i = 0; i < genericLayoutTree.length; i++) {
e.emitTestPrologue(genericLayoutTree[i].name, genericLayoutTree[i].experiments);
e.emitTestPrologue(
genericLayoutTree[i].name,
genericLayoutTree[i].experiments,
genericLayoutTree[i].disabled
);
if (genericLayoutTree[i].name == 'wrap_column') {
// Modify width and left values due to both safari and chrome not abiding by the
@@ -475,9 +479,10 @@ function calculateTree(root, roundToPixelGrid) {
style: getYogaStyle(child),
declaredStyle: child.style,
rawStyle: child.getAttribute('style'),
experiments: child.getAttribute('experiments')
? child.getAttribute('experiments').split(' ')
experiments: child.dataset.experiments
? child.dataset.experiments.split(' ')
: DEFAULT_EXPERIMENTS,
disabled: child.dataset.disabled === 'true',
};
var size = getRoundedSize(child);