@testspectra/react 1.3.4 → 1.3.6

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.js CHANGED
@@ -64,6 +64,7 @@ function emitEvent(tag, payload) {
64
64
  console.log(`[${tag}] ${payload}`);
65
65
  }
66
66
  var stepContext = { index: 0, label: "" };
67
+ var groupStack = [];
67
68
  var lastResolved;
68
69
  function describeTarget(target) {
69
70
  if (target === void 0 || target === null) return "";
@@ -85,8 +86,17 @@ async function trackStep(category, payloadObj, fn) {
85
86
  const workerId = globalThis.__TESTSPECTRA_WORKER_ID__;
86
87
  if (currentTest && !payloadObj.test) payloadObj.test = currentTest;
87
88
  if (workerId !== void 0 && payloadObj.workerId === void 0) payloadObj.workerId = workerId;
88
- stepContext = { index: stepContext.index + 1, label: `${payloadObj.key} ${describeTarget(payloadObj.target)}`.trim() };
89
+ const group = groupStack[groupStack.length - 1];
90
+ stepContext = {
91
+ index: stepContext.index + 1,
92
+ label: `${payloadObj.key} ${describeTarget(payloadObj.target)}`.trim(),
93
+ group
94
+ };
89
95
  payloadObj.step = stepContext.index;
96
+ if (group !== void 0) {
97
+ payloadObj.group = group;
98
+ payloadObj.groupPath = [...groupStack];
99
+ }
90
100
  lastResolved = void 0;
91
101
  emitEvent("TESTSPECTRA_STEP_START", JSON.stringify(payloadObj));
92
102
  const start = Date.now();
@@ -795,7 +805,7 @@ var DomDriverBridge = class {
795
805
  const before = readTypedValue(el);
796
806
  await getUser().type(el, text);
797
807
  const landed = readTypedValue(el);
798
- if (!typedTextLanded(text, landed, before)) {
808
+ if (!typedTextLanded((before ?? "") + text, landed, before)) {
799
809
  throw typedTextError(selectorText(selector), text, landed ?? "");
800
810
  }
801
811
  }