testomatio-editor-blocks 0.4.40 → 0.4.44

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.
@@ -795,9 +795,11 @@ function parseTestStep(lines, index, allowEmpty = false, snippetId) {
795
795
  let expectedResult = "";
796
796
  let next = index + 1;
797
797
  let inExpectedResult = false;
798
+ const stepIndent = current.length - current.trimStart().length;
798
799
  while (next < lines.length) {
799
800
  const line = lines[next];
800
- const hasIndent = /^\s{2,}/.test(line);
801
+ const lineIndent = line.length - line.trimStart().length;
802
+ const hasIndent = lineIndent > stepIndent;
801
803
  const rawTrimmed = line.trim();
802
804
  if (!rawTrimmed) {
803
805
  if (stepDataLines.length > 0 || inExpectedResult) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testomatio-editor-blocks",
3
- "version": "0.4.40",
3
+ "version": "0.4.44",
4
4
  "description": "Custom BlockNote schema, markdown conversion helpers, and UI for Testomatio-style test cases and steps.",
5
5
  "type": "module",
6
6
  "main": "./package/index.js",
@@ -1018,12 +1018,21 @@ describe("markdownToBlocks", () => {
1018
1018
  "",
1019
1019
  " * Open login page",
1020
1020
  " *Expected*: The main page is opened",
1021
+ " * Enter username {{username}} and password ${password}",
1022
+ " * Click login button",
1023
+ " * Verify user is redirected to the dashboard",
1021
1024
  ].join("\n");
1022
1025
 
1023
1026
  const blocks = markdownToBlocks(markdown);
1024
1027
  expect(blocks.length).toBeGreaterThan(0);
1025
- const bullets = blocks.filter((b) => b.type === "bulletListItem");
1026
- expect(bullets.length).toBeGreaterThanOrEqual(1);
1028
+
1029
+ const steps = blocks.filter((b) => b.type === "testStep");
1030
+ expect(steps).toHaveLength(4);
1031
+ expect((steps[0].props as any).stepTitle).toBe("Open login page");
1032
+ expect((steps[0].props as any).expectedResult).toBe("The main page is opened");
1033
+ expect((steps[1].props as any).stepTitle).toBe("Enter username {{username}} and password ${password}");
1034
+ expect((steps[2].props as any).stepTitle).toBe("Click login button");
1035
+ expect((steps[3].props as any).stepTitle).toBe("Verify user is redirected to the dashboard");
1027
1036
  });
1028
1037
 
1029
1038
  it("parses expected result prefixes with emphasis", () => {
@@ -964,10 +964,12 @@ function parseTestStep(
964
964
  let expectedResult = "";
965
965
  let next = index + 1;
966
966
  let inExpectedResult = false;
967
+ const stepIndent = current.length - current.trimStart().length;
967
968
 
968
969
  while (next < lines.length) {
969
970
  const line = lines[next];
970
- const hasIndent = /^\s{2,}/.test(line);
971
+ const lineIndent = line.length - line.trimStart().length;
972
+ const hasIndent = lineIndent > stepIndent;
971
973
  const rawTrimmed = line.trim();
972
974
 
973
975
  if (!rawTrimmed) {