bdd_widget_test icon indicating copy to clipboard operation
bdd_widget_test copied to clipboard

When parsing step with both a variable and a grid, the step file is created incorrectly

Open daniel-deboeverie-lemon opened this issue 1 year ago • 0 comments

When you have a line like the following:

Given {"Steve Jobs"} has a visit planned
      | "id"                 | 1                          |
      | "date"               | "2024-05-01T08:00:00.000Z" |
      | "patientFirstName"   | "Tim"                   |
      | "patientLastName"    | "Cook"                 |
      | "patientBirthDate"   | "1938-05-01T00:00:00.000Z" |
      | "sex"                | "MALE"                     |

the created step file looks like this:

/// Usage: {"Steve Jobs"} has a visit planned
Future<void> hasAVisitPlanned(
  WidgetTester tester,
  bdd.DataTable dataTable
) async {}

and the created usage looks like this:

 await hasAVisitPlanned(
            tester,
            "Steve Jobs",
            const bdd.DataTable([
              ["id", 1],
              ["date", "2024-05-01T08:00:00.000Z"],
              ["patientFirstName", "Tim"],
              ["patientLastName", "Cook"],
              ["patientBirthDate", "1938-05-01T00:00:00.000Z"],
              ["sex", "MALE"]
            ]));

The usage is created correctly, but the step file isn't. The step file should instead be something like this:

/// Usage: {"Steve Jobs"} has a visit planned
Future<void> hasAVisitPlanned(
  WidgetTester tester,
  String param1,
  bdd.DataTable dataTable
) async {}

daniel-deboeverie-lemon avatar Sep 09 '24 07:09 daniel-deboeverie-lemon