pasika 0.5.8 → 0.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -124,9 +124,11 @@ function findSimpleRoot(component, _text, _filename) {
|
|
|
124
124
|
};
|
|
125
125
|
visit(body);
|
|
126
126
|
const rendered = returns.filter((statement) => statement.expression?.kind !== ts.SyntaxKind.NullKeyword);
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
127
|
+
const roots = rendered.map((statement) => statement.expression && ts.isExpression(statement.expression) ? rootFromExpression(statement.expression) : void 0).filter((root) => root !== void 0);
|
|
128
|
+
if (roots.length !== rendered.length || roots.length === 0) return void 0;
|
|
129
|
+
const firstTag = roots[0]?.tagName;
|
|
130
|
+
if (roots.some((root) => root.tagName !== firstTag)) return void 0;
|
|
131
|
+
return roots[0];
|
|
130
132
|
}
|
|
131
133
|
function getTestId(root) {
|
|
132
134
|
const attribute = root.attributes.find(
|