Skip to content

Commit

Permalink
Move embed to a specific file
Browse files Browse the repository at this point in the history
  • Loading branch information
jdeniau committed Jun 14, 2024
1 parent 81c5e44 commit 58e805a
Show file tree
Hide file tree
Showing 3 changed files with 162 additions and 110 deletions.
208 changes: 125 additions & 83 deletions tests/plugin/__snapshots__/jsfmt.spec.mjs.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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
<feed>
<account number="123456789">
<entry>
<type>credit</type>
<amount>1000</amount>
<label>My company salary</label>
</entry>
</account>
</feed>
"""
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
<feed>
<account number="123456789">
<entry>
<type>credit</type>
<amount>1000</amount>
<label>My company salary</label>
</entry>
</account>
</feed>
"""
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
<feed>
<account number="123456789">
<entry>
<type>credit</type>
<amount>1000</amount>
<label>My company salary</label>
</entry>
</account>
</feed>
"""
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
Expand Down Expand Up @@ -283,33 +408,6 @@ Feature: accountability
]
"""
When I receive the following feed from the bank:
"""xml
<feed>
<account number="123456789">
<entry>
<type>credit</type>
<amount>1000</amount>
<label>My company salary</label>
</entry>
</account>
</feed>
"""
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: {}
Expand Down Expand Up @@ -356,35 +454,6 @@ Feature: accountability
]
"""
When I receive the following feed from the bank:
"""xml
<feed>
<account number="123456789">
<entry>
<type>credit</type>
<amount>1000</amount>
<label>My company salary</label>
</entry>
</account>
</feed>
"""
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
Expand Down Expand Up @@ -433,33 +502,6 @@ Feature: accountability
]
"""
When I receive the following feed from the bank:
"""xml
<feed>
<account number="123456789">
<entry>
<type>credit</type>
<amount>1000</amount>
<label>My company salary</label>
</entry>
</account>
</feed>
"""
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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
`;
Expand Down
37 changes: 37 additions & 0 deletions tests/plugin/embed.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Feature: Test different embed

Scenario: XML
When I receive the following feed from the bank:
"""xml
<feed>
<account number="123456789">
<entry>
<type>credit</type>
<amount>1000</amount>
<label>My company salary</label>
</entry>
</account>
</feed>
"""

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
}
}
}
"""
27 changes: 0 additions & 27 deletions tests/plugin/example.feature
Original file line number Diff line number Diff line change
Expand Up @@ -39,30 +39,3 @@ Feature: accountability
]
"""

When I receive the following feed from the bank:
"""xml
<feed>
<account number="123456789">
<entry>
<type>credit</type>
<amount>1000</amount>
<label>My company salary</label>
</entry>
</account>
</feed>
"""

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

0 comments on commit 58e805a

Please sign in to comment.