-
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
7a093ab
commit 3e4a5ed
Showing
104 changed files
with
1,174 additions
and
507 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
12 changes: 12 additions & 0 deletions
12
apps/pathway-design/server/src/specs/change-title-pathway/index.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Feature: Change the title of a pathway in a memory database with json presenter | ||
|
||
Scenario: I want to change the title of a learning pathway | ||
Given I am authenticated on the platform for change the title of the pathway in memory persistence and json presenter | ||
Given I have a pathway recorded in memory with these data | ||
| title | description | researchField | | ||
| My Pathway | A test pathway | biology | | ||
When I want to change the title of the pathway in memory to "My New Pathway" | ||
Then I should receive from memory the new title of the pathway | ||
| title | | ||
| My New Pathway | | ||
|
67 changes: 67 additions & 0 deletions
67
apps/pathway-design/server/src/specs/change-title-pathway/index.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 |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { strict as assert } from 'node:assert'; | ||
import type { Http2Server } from 'node:http2'; | ||
import { PDSPIPPathwayPersistenceInfrastructureModule } from '@bewoak/pathway-design-server-pathway-infrastructure'; | ||
import { | ||
PDSPIAChangeTitlePathwayInterfaceAdaptersModule, | ||
PDSPIAInitializePathwayInterfaceAdaptersModule, | ||
} from '@bewoak/pathway-design-server-pathway-interface-adapters'; | ||
import { PDSPPPathwayPresentersModule } from '@bewoak/pathway-design-server-pathway-presenters'; | ||
import type { DataTable } from '@cucumber/cucumber'; | ||
import type { INestApplication } from '@nestjs/common'; | ||
import { CqrsModule } from '@nestjs/cqrs'; | ||
import { Test } from '@nestjs/testing'; | ||
import { binding, given, then, when } from 'cucumber-tsflow'; | ||
import request from 'supertest'; | ||
|
||
@binding() | ||
class ControllerSteps { | ||
private app: INestApplication; | ||
private httpServer: Http2Server; | ||
private response: request.Response; | ||
|
||
@given('I am authenticated on the platform for change the title of the pathway in memory persistence and json presenter') | ||
public async withInMemoryPeristenceAndJsonPresenter() { | ||
const testingModule = await Test.createTestingModule({ | ||
imports: [ | ||
PDSPIAChangeTitlePathwayInterfaceAdaptersModule.withPresenter(PDSPPPathwayPresentersModule.use('toJson')) | ||
.withPersistence(PDSPIPPathwayPersistenceInfrastructureModule.use('inMemory')) | ||
.build(), | ||
PDSPIAInitializePathwayInterfaceAdaptersModule.withPresenter(PDSPPPathwayPresentersModule.use('toJson')) | ||
.withPersistence(PDSPIPPathwayPersistenceInfrastructureModule.use('inMemory')) | ||
.build(), | ||
CqrsModule.forRoot(), | ||
], | ||
}).compile(); | ||
|
||
this.app = testingModule.createNestApplication(); | ||
await this.app.init(); | ||
this.httpServer = this.app.getHttpServer(); | ||
} | ||
|
||
@given('I have a pathway recorded in memory with these data') | ||
public async givenIHaveAPathwayRecordedInMemroy(dataTable: DataTable) { | ||
const firstRow = dataTable.hashes()[0]; | ||
|
||
this.response = await request(this.httpServer).post('/pathway/init').send({ | ||
title: firstRow.title, | ||
description: firstRow.description, | ||
researchField: firstRow.researchField, | ||
}); | ||
} | ||
|
||
@when('I want to change the title of the pathway in memory to {string}') | ||
public async whenIChangeTheTitleOfThePathwayTo(title: string) { | ||
this.response = await request(this.httpServer).patch(`/pathway/change-title/${this.response.body.id}`).send({ | ||
title, | ||
}); | ||
} | ||
|
||
@then('I should receive from memory the new title of the pathway') | ||
public async thenIShouldReceiveTheNewTitleOfThePathway(dataTable: DataTable) { | ||
const firstRow = dataTable.hashes()[0]; | ||
|
||
assert.strictEqual(this.response.body.title, firstRow.title); | ||
} | ||
} | ||
|
||
export = ControllerSteps; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"jsc": { | ||
"target": "es2022", | ||
"parser": { | ||
"syntax": "typescript", | ||
"decorators": true, | ||
"dynamicImport": true | ||
}, | ||
"transform": { | ||
"decoratorMetadata": true, | ||
"legacyDecorator": true | ||
}, | ||
"keepClassNames": true, | ||
"externalHelpers": true, | ||
"loose": true | ||
}, | ||
"module": { | ||
"type": "es6" | ||
}, | ||
"sourceMaps": true, | ||
"exclude": [".*\\.spec.tsx?$", ".*\\.step.ts$", ".*\\.test.tsx?$", ".*.js$"] | ||
} |
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,17 @@ | ||
{ | ||
"$schema": "../../../node_modules/@biomejs/biome/configuration_schema.json", | ||
"extends": ["../../../biome.json"], | ||
"linter": { | ||
"rules": { | ||
"nursery": { | ||
"noRestrictedImports": { | ||
"options": { | ||
"paths": {} | ||
}, | ||
"level": "error" | ||
} | ||
} | ||
} | ||
}, | ||
"overrides": [{}] | ||
} |
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,11 @@ | ||
module.exports = { | ||
default: { | ||
paths: ['libs/common/events/src/lib/**/*.feature'], | ||
requireModule: ['ts-node/register', 'tsconfig-paths/register'], | ||
require: ['libs/common/events/src/lib/**/*.step.ts'], | ||
format: [ | ||
'json:dist/reports/libs/common/events/test-feature/index.json', | ||
'html:dist/reports/libs/common/events/test-feature/index.html', | ||
], | ||
}, | ||
}; |
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,9 @@ | ||
{ | ||
"name": "@bewoak/common-events", | ||
"version": "0.0.1", | ||
"dependencies": { | ||
"@swc/helpers": "~0.5.11" | ||
}, | ||
"main": "./src/index.js", | ||
"typings": "./src/index.d.ts" | ||
} |
Oops, something went wrong.