-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add test for outline with placeholder
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
examples/typescript/specs/step-definitions/auto-step-binding-outline.steps.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { StepDefinitions, autoBindSteps, loadFeature } from '../../../../src'; | ||
import { OnlineSales } from '../../src/online-sales'; | ||
|
||
export const salesSteps: StepDefinitions = ({ given, when, then }) => { | ||
let onlineSales: OnlineSales; | ||
let salesPrice: number | null; | ||
|
||
beforeEach(() => { | ||
onlineSales = new OnlineSales(); | ||
}); | ||
|
||
given(/^I have a\(n\) (.+)$/, (item: string) => { | ||
onlineSales.listItem(item); | ||
}); | ||
|
||
when(/^I sell the (.+)$/, (item: string) => { | ||
salesPrice = onlineSales.sellItem(item); | ||
}); | ||
|
||
then(/^I should get \$(\d+)$/, (expectedSalesPrice: string) => { | ||
expect(salesPrice).toBe(parseInt(expectedSalesPrice, 10)); | ||
}); | ||
}; | ||
|
||
const feature = loadFeature('./examples/typescript/specs/features/scenario-outlines.feature'); | ||
|
||
autoBindSteps([feature], [salesSteps]); |