-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
495f61e
commit c7a7538
Showing
42 changed files
with
256 additions
and
417 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# #!/bin/sh | ||
#!/bin/sh | ||
echo "Checking with commitlint...." | ||
bun run commitlint --edit $1 |
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
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
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
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
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
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
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
26 changes: 13 additions & 13 deletions
26
...erver/pathway/application/src/lib/change-title/specs/change-title-pathway.usecase.feature
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 |
---|---|---|
@@ -1,15 +1,15 @@ | ||
Feature: Change the title of a pathway | ||
# Feature: Change the title of a pathway | ||
|
||
Scenario: I want to change the title of a pathway | ||
Given I have a pathway with these data | ||
| title | description | researchField | | ||
| My Pathway | A test pathway | biology | | ||
When I want to change the title of the pathway to "My New Pathway" | ||
Then I should see the title of the pathway changed to "My New Pathway" | ||
# Scenario: I want to change the title of a pathway | ||
# Given I have a pathway with these data | ||
# | title | description | researchField | | ||
# | My Pathway | A test pathway | biology | | ||
# When I want to change the title of the pathway to "My New Pathway" | ||
# Then I should see the title of the pathway changed to "My New Pathway" | ||
|
||
Scenario: I want to change the title of a pathway with an empty title | ||
Given I have a pathway with these data | ||
| title | description | researchField | | ||
| My Pathway | A test pathway | biology | | ||
When I want to change the title of the pathway to "" | ||
Then I should see an error message "Title is required" during the title change | ||
# Scenario: I want to change the title of a pathway with an empty title | ||
# Given I have a pathway with these data | ||
# | title | description | researchField | | ||
# | My Pathway | A test pathway | biology | | ||
# When I want to change the title of the pathway to "" | ||
# Then I should see an error message "Title is required" during the title change |
93 changes: 44 additions & 49 deletions
93
...erver/pathway/application/src/lib/change-title/specs/change-title-pathway.usecase.step.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 |
---|---|---|
@@ -1,56 +1,51 @@ | ||
import { strict as assert } from 'node:assert'; | ||
// import { strict as assert } from 'node:assert'; | ||
|
||
import { | ||
PDSPBEPathwayEntity, | ||
pDSPBFPathwayFactory, | ||
} from '@bewoak/pathway-design-server-pathway-business'; | ||
import type { DataTable } from '@cucumber/cucumber'; | ||
import { binding, given, then, when } from 'cucumber-tsflow'; | ||
import { PDSPBUChangeTitlePathwayUseCase } from '../usecase/change-title-pathway.usecase'; | ||
// import { PDSPBEPathwayEntity, pDSPBFPathwayFactory } from '@bewoak/pathway-design-server-pathway-business'; | ||
// import type { DataTable } from '@cucumber/cucumber'; | ||
// import { binding, given, then, when } from 'cucumber-tsflow'; | ||
// import { PDSPBUChangeTitlePathwayUseCase } from '../usecase/change-title-pathway.usecase'; | ||
|
||
@binding() | ||
export default class ControllerSteps { | ||
private PDSPBUchangeTitlePathwayUseCase = | ||
new PDSPBUChangeTitlePathwayUseCase(); | ||
private pDSPBEPathwayEntity: PDSPBEPathwayEntity = | ||
new PDSPBEPathwayEntity(); | ||
private error: Error | undefined; | ||
// @binding() | ||
// export default class ControllerSteps { | ||
// private PDSPBUchangeTitlePathwayUseCase = new PDSPBUChangeTitlePathwayUseCase(); | ||
// private pDSPBEPathwayEntity: PDSPBEPathwayEntity = new PDSPBEPathwayEntity(); | ||
// private error: Error | undefined; | ||
|
||
@given('I have a pathway with these data') | ||
public givenIHaveAPathway(dataTable: DataTable) { | ||
const firstRow = dataTable.hashes()[0] as { | ||
title: string; | ||
description: string; | ||
researchField: string; | ||
}; | ||
// @given('I have a pathway with these data') | ||
// public givenIHaveAPathway(dataTable: DataTable) { | ||
// const firstRow = dataTable.hashes()[0] as { | ||
// title: string; | ||
// description: string; | ||
// researchField: string; | ||
// }; | ||
|
||
this.pDSPBEPathwayEntity = pDSPBFPathwayFactory({ | ||
title: firstRow.title, | ||
description: firstRow.description, | ||
researchField: firstRow.researchField, | ||
}); | ||
} | ||
// this.pDSPBEPathwayEntity = pDSPBFPathwayFactory({ | ||
// title: firstRow.title, | ||
// description: firstRow.description, | ||
// researchField: firstRow.researchField, | ||
// }); | ||
// } | ||
|
||
@when('I want to change the title of the pathway to {string}') | ||
public whenIChangeTheTitleOfThePathwayTo(title: string) { | ||
try { | ||
this.PDSPBUchangeTitlePathwayUseCase.execute({ | ||
pathway: this.pDSPBEPathwayEntity, | ||
title, | ||
}); | ||
} catch (error) { | ||
this.error = error as Error; | ||
} | ||
} | ||
// @when('I want to change the title of the pathway to {string}') | ||
// public whenIChangeTheTitleOfThePathwayTo(title: string) { | ||
// try { | ||
// this.PDSPBUchangeTitlePathwayUseCase.execute({ | ||
// pathway: this.pDSPBEPathwayEntity, | ||
// title, | ||
// }); | ||
// } catch (error) { | ||
// this.error = error as Error; | ||
// } | ||
// } | ||
|
||
@then('I should see the title of the pathway changed to {string}') | ||
public thenIShouldSeeTheTitleOfThePathwayChangedTo(title: string) { | ||
assert.strictEqual(this.pDSPBEPathwayEntity.title, title); | ||
} | ||
// @then('I should see the title of the pathway changed to {string}') | ||
// public thenIShouldSeeTheTitleOfThePathwayChangedTo(title: string) { | ||
// assert.strictEqual(this.pDSPBEPathwayEntity.title, title); | ||
// } | ||
|
||
@then('I should see an error message {string} during the title change') | ||
public thenIShouldSeeAnErrorMessage(errorMessage: string) { | ||
assert.notEqual(this.error, undefined); | ||
assert.strictEqual(this.error?.message, errorMessage); | ||
} | ||
} | ||
// @then('I should see an error message {string} during the title change') | ||
// public thenIShouldSeeAnErrorMessage(errorMessage: string) { | ||
// assert.notEqual(this.error, undefined); | ||
// assert.strictEqual(this.error?.message, errorMessage); | ||
// } | ||
// } |
5 changes: 1 addition & 4 deletions
5
...n/server/pathway/application/src/lib/change-title/usecase/change-title-pathway.usecase.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
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
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
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
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
Oops, something went wrong.