From 1d5ab62dbfec45ac3739f30df5d94820ed0b1bb5 Mon Sep 17 00:00:00 2001 From: Julien Deniau Date: Fri, 14 Jun 2024 06:24:07 +0000 Subject: [PATCH] Move embed to a specific file --- .../plugin/__snapshots__/jsfmt.spec.mjs.snap | 208 +++++++++++------- tests/plugin/embed.feature | 37 ++++ tests/plugin/example.feature | 28 --- 3 files changed, 162 insertions(+), 111 deletions(-) create mode 100644 tests/plugin/embed.feature diff --git a/tests/plugin/__snapshots__/jsfmt.spec.mjs.snap b/tests/plugin/__snapshots__/jsfmt.spec.mjs.snap index 6efffab..a5b7734 100644 --- a/tests/plugin/__snapshots__/jsfmt.spec.mjs.snap +++ b/tests/plugin/__snapshots__/jsfmt.spec.mjs.snap @@ -238,6 +238,131 @@ Feature: complex docstring with JSON in it ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ `; +exports[`embed.feature 1`] = ` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +source +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Feature: Test different embed + + Scenario: XML + When I receive the following feed from the bank: + """xml + + + + credit + 1000 + + + + + """ + + Scenario: JSON + When I receive the following feed from the bank: + """json + { "account": + "1234", + "amount": 1000} + """ + + Scenario: GraphQL + When I make the following query to the API: + """graphql + union Transaction = CreditTransaction|DebitTransaction + + query AccountBalance($accountNumber:String!) { + account(accountNumber:$accountNumber) { + balance + transactions { amount + } + } + } + """ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +options: {} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Feature: Test different embed + + Scenario: XML + When I receive the following feed from the bank: + """xml + + + + credit + 1000 + + + + + """ + + Scenario: JSON + When I receive the following feed from the bank: + """json + { "account": "1234", "amount": 1000 } + """ + + Scenario: GraphQL + When I make the following query to the API: + """graphql + union Transaction = CreditTransaction|DebitTransaction + + query AccountBalance($accountNumber:String!) { + account(accountNumber:$accountNumber) { + balance + transactions { amount + } + } + } + """ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +options: { + "forceNewlineBetweenStepBlocks": true +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Feature: Test different embed + + Scenario: XML + When I receive the following feed from the bank: + """xml + + + + credit + 1000 + + + + + """ + + Scenario: JSON + When I receive the following feed from the bank: + """json + { "account": "1234", "amount": 1000 } + """ + + Scenario: GraphQL + When I make the following query to the API: + """graphql + union Transaction = CreditTransaction|DebitTransaction + + query AccountBalance($accountNumber:String!) { + account(accountNumber:$accountNumber) { + balance + transactions { amount + } + } + } + """ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +`; + exports[`example.feature 1`] = ` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ source @@ -283,33 +408,6 @@ Feature: accountability ] """ - When I receive the following feed from the bank: - """xml - - - - credit - 1000 - - - - - """ - - And I make the following query to the API: - """graphql - union Transaction = CreditTransaction|DebitTransaction - - query AccountBalance($accountNumber:String!) { - account(accountNumber:$accountNumber) { - balance - transactions { amount - } - } - } - """ - - Then the response status code should be 200 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ options: {} @@ -356,35 +454,6 @@ Feature: accountability ] """ - When I receive the following feed from the bank: - """xml - - - - credit - 1000 - - - - - """ - - And I make the following query to the API: - """graphql - union Transaction = CreditTransaction | DebitTransaction - - query AccountBalance($accountNumber: String!) { - account(accountNumber: $accountNumber) { - balance - transactions { - amount - } - } - } - """ - - Then the response status code should be 200 - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ options: { "forceNewlineBetweenStepBlocks": true @@ -433,33 +502,6 @@ Feature: accountability ] """ - When I receive the following feed from the bank: - """xml - - - - credit - 1000 - - - - - """ - And I make the following query to the API: - """graphql - union Transaction = CreditTransaction | DebitTransaction - - query AccountBalance($accountNumber: String!) { - account(accountNumber: $accountNumber) { - balance - transactions { - amount - } - } - } - """ - Then the response status code should be 200 - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ `; diff --git a/tests/plugin/embed.feature b/tests/plugin/embed.feature new file mode 100644 index 0000000..ca4b738 --- /dev/null +++ b/tests/plugin/embed.feature @@ -0,0 +1,37 @@ +Feature: Test different embed + + Scenario: XML + When I receive the following feed from the bank: + """xml + + + + credit + 1000 + + + + + """ + + Scenario: JSON + When I receive the following feed from the bank: + """json + { "account": + "1234", + "amount": 1000} + """ + + Scenario: GraphQL + When I make the following query to the API: + """graphql + union Transaction = CreditTransaction|DebitTransaction + + query AccountBalance($accountNumber:String!) { + account(accountNumber:$accountNumber) { + balance + transactions { amount + } + } + } + """ diff --git a/tests/plugin/example.feature b/tests/plugin/example.feature index 18596b0..13de841 100644 --- a/tests/plugin/example.feature +++ b/tests/plugin/example.feature @@ -38,31 +38,3 @@ Feature: accountability } ] """ - - When I receive the following feed from the bank: - """xml - - - - credit - 1000 - - - - - """ - - And I make the following query to the API: - """graphql - union Transaction = CreditTransaction|DebitTransaction - - query AccountBalance($accountNumber:String!) { - account(accountNumber:$accountNumber) { - balance - transactions { amount - } - } - } - """ - - Then the response status code should be 200