Skip to content

Commit

Permalink
Check in the integration tests that the reset actually takes effect.
Browse files Browse the repository at this point in the history
  • Loading branch information
SyntaxColoring committed Nov 20, 2023
1 parent 5ba8930 commit f8c1c20
Showing 1 changed file with 24 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ stages:
# after they're done. We probably need some kind of deck configuration factory-reset.
#
# lastUpdatedAt: null
cutoutFixtures:
cutoutFixtures: &expectedDefaultCutoutFixtures
- cutoutFixtureId: singleLeftSlot
cutoutId: cutoutA1
- cutoutFixtureId: singleLeftSlot
Expand Down Expand Up @@ -52,7 +52,7 @@ stages:
method: PUT
json:
data:
cutoutFixtures: &expectedCutoutFixtures
cutoutFixtures: &expectedNonDefaultCutoutFixtures
- cutoutFixtureId: singleLeftSlot
cutoutId: cutoutA1
- cutoutFixtureId: singleLeftSlot
Expand Down Expand Up @@ -87,7 +87,7 @@ stages:
json:
data:
lastUpdatedAt: !anystr
cutoutFixtures: *expectedCutoutFixtures
cutoutFixtures: *expectedNonDefaultCutoutFixtures
save:
json:
last_updated_at: data.lastUpdatedAt
Expand Down Expand Up @@ -143,4 +143,24 @@ stages:
json:
data:
lastUpdatedAt: '{last_updated_at}'
cutoutFixtures: *expectedCutoutFixtures
cutoutFixtures: *expectedNonDefaultCutoutFixtures

# We test this here even though there are separate Tavern tests for POST /settings/reset
# because this is a convenient place to check that the reset actually takes effect.
- name: Reset the deck configuration
request:
url: '{ot3_server_base_url}/settings/reset'
method: POST
json:
deckConfiguration: true
response: {} # Expecting any non-error response.

- name: Get the deck configuration after the reset and make sure it's immediately gone back to the default
request:
url: '{ot3_server_base_url}/deck_configuration'
response:
json:
data:
# lastUpdatedAt is deliberately omitted from this expected object.
# See notes above.
cutoutFixtures: *expectedDefaultCutoutFixtures

0 comments on commit f8c1c20

Please sign in to comment.