Skip to content

Commit

Permalink
add test for resources check for task 101
Browse files Browse the repository at this point in the history
  • Loading branch information
customcommander committed Oct 19, 2024
1 parent cb002c8 commit 8780c7c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
7 changes: 7 additions & 0 deletions test/acceptance/101.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Feature: Build Rooms and/or Build Stables

Scenario: Abort task if player does not have enough resources
Given I start playing
When I select "Build Rooms and/or Build Stables"
Then the game tells me I do not have enough resources

19 changes: 12 additions & 7 deletions test/acceptance/steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ import {
} from '@cucumber/cucumber';

const task_map = {
'Day Laborer' : 106,
'Plow 1 Field' : 104,
'Sow and/or Bake bread': 113,
'Take 1 Grain' : 103,
'Take x Clay' : 108,
'Take x Reed' : 109,
'Take x Wood' : 107,
'Build Rooms and/or Build Stables': 101,
'Day Laborer' : 106,
'Plow 1 Field' : 104,
'Sow and/or Bake bread' : 113,
'Take 1 Grain' : 103,
'Take x Clay' : 108,
'Take x Reed' : 109,
'Take x Wood' : 107,
};

const stock_map = {
Expand Down Expand Up @@ -65,3 +66,7 @@ When('I feed my family', async function () {
await this.send({type: 'task.completed', task_id: '002'});
});

Then('the game tells me I do not have enough resources', async function () {
await this.assert(game => game.error === 'NOT_ENOUGH_RESOURCES');
});

0 comments on commit 8780c7c

Please sign in to comment.