@immense/vue-pom-generator 1.0.39 → 1.0.40

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.
package/dist/index.mjs CHANGED
@@ -2054,9 +2054,6 @@ Fix: either (1) include ${args.bestKeyPlaceholder} in your :${attrLabel} templat
2054
2054
  })();
2055
2055
  const tryMergeWithExistingPrimary = (candidateActionName) => {
2056
2056
  const mergeKey = (args.pomMergeKey ?? "").trim();
2057
- if (isKeyed) {
2058
- return false;
2059
- }
2060
2057
  const existingEntry = primaryByActionName.get(candidateActionName);
2061
2058
  const existingPom = existingEntry?.pom;
2062
2059
  if (!existingEntry || !existingPom) {
@@ -2067,6 +2064,9 @@ Fix: either (1) include ${args.bestKeyPlaceholder} in your :${attrLabel} templat
2067
2064
  ...existingPom.alternateFormattedDataTestIds ?? []
2068
2065
  ];
2069
2066
  const sharesSelectorIdentity = existingSelectors.includes(formattedDataTestIdForPom);
2067
+ if (isKeyed && !sharesSelectorIdentity) {
2068
+ return false;
2069
+ }
2070
2070
  if (!mergeKey && !sharesSelectorIdentity) {
2071
2071
  return false;
2072
2072
  }
@@ -2113,6 +2113,11 @@ Fix: either (1) include ${args.bestKeyPlaceholder} in your :${attrLabel} templat
2113
2113
  conflicts = false;
2114
2114
  }
2115
2115
  }
2116
+ if (conflicts && nameCollisionBehavior === "error" && tryMergeWithExistingPrimary(actionName)) {
2117
+ methodName = candidate;
2118
+ mergedIntoExisting = true;
2119
+ break;
2120
+ }
2116
2121
  if (conflicts && nameCollisionBehavior === "error") {
2117
2122
  const roleSuffix = upperFirst(normalizedRole || "Element");
2118
2123
  const baseNameUpper = upperFirst(baseWithSuffix);
@@ -2159,11 +2164,6 @@ Fix: either (1) include ${args.bestKeyPlaceholder} in your :${attrLabel} templat
2159
2164
  reservedMembers.add(actionName);
2160
2165
  break;
2161
2166
  }
2162
- if (nameCollisionBehavior === "error" && tryMergeWithExistingPrimary(actionName)) {
2163
- methodName = candidate;
2164
- mergedIntoExisting = true;
2165
- break;
2166
- }
2167
2167
  if (!collisionDetails) {
2168
2168
  collisionDetails = { getterName: chosenGetterName, actionName };
2169
2169
  collisionHint = hint || (args.semanticNameHint ?? "").trim() || null;
@@ -3740,6 +3740,7 @@ function generateAggregatedCSharpFiles(componentHierarchyMap, outDir, options =
3740
3740
  chunks.push(" {");
3741
3741
  if (pom.formattedDataTestId.includes("${") || allTestIds.length <= 1) {
3742
3742
  chunks.push(` await ${locatorName}${pom.formattedDataTestId.includes("${") ? `(${args})` : ""}.ClickAsync();`);
3743
+ chunks.push(` return new ${target}(Page);`);
3743
3744
  } else {
3744
3745
  chunks.push(" Exception? lastError = null;");
3745
3746
  chunks.push(` foreach (var testId in new[] { ${allTestIds.map(toCSharpTestIdExpression).join(", ")} })`);
@@ -3760,7 +3761,6 @@ function generateAggregatedCSharpFiles(componentHierarchyMap, outDir, options =
3760
3761
  chunks.push(" }");
3761
3762
  chunks.push(' throw lastError ?? new System.Exception("[pom] Failed to navigate using any candidate test id.");');
3762
3763
  }
3763
- chunks.push(` return new ${target}(Page);`);
3764
3764
  chunks.push(" }");
3765
3765
  chunks.push("");
3766
3766
  continue;