Skip to content

Commit

Permalink
refactor: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
collettemathieu committed Aug 4, 2024
1 parent 644442f commit 807da0d
Show file tree
Hide file tree
Showing 17 changed files with 344 additions and 285 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,14 @@ Feature: Initialize Pathway in a memory database
| title | description | researchField |
| My Pathway | A test pathway | biology |
Then The pathway should be have a unique identifier

Scenario: I want to initialize another learning pathway with different data
Given I am authenticated on the platform
When I want to initialize a pathway with these data
| title | description | researchField |
| Arterial stiffness | Understand the role of the arterial stiffness | biomedical |
Then I should retrieve a pathway initialized with its data
| title | description | researchField |
| Arterial stiffness | Understand the role of the arterial stiffness | biomedical |
Then The pathway should be have a unique identifier

Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { strict as assert } from 'node:assert';
import type { Http2Server } from 'node:http2';
import { PDSPIInitializePathwayPersistenceInfrastructureModule } from '@bewoak/pathway-design-server-pathway-infrastructure';
import { PDSPIAInitializePathwayInterfaceAdaptersModule } from '@bewoak/pathway-design-server-pathway-interface-adapters';
import { PDSPPPathwayPresentersModule } from '@bewoak/pathway-design-server-pathway-presenters';
Expand All @@ -8,6 +6,8 @@ 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 { strict as assert } from 'node:assert';
import type { Http2Server } from 'node:http2';
import request from 'supertest';

@binding()
Expand Down Expand Up @@ -67,6 +67,7 @@ class ControllerSteps {
@then('The pathway should be have a unique identifier')
public thenThePathwayIdentifierShouldBeUnique() {
assert.notEqual(this.response.body.id, undefined);
assert.notEqual(this.response.body.id, '');
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default class ControllerSteps {

@then('I should see the title of the pathway changed to {string}')
public thenIShouldSeeTheTitleOfThePathwayChangedTo(title: string) {
assert.strictEqual(this.pDSPBEPathwayEntity?.title?.value, title);
assert.strictEqual(this.pDSPBEPathwayEntity.title, title);
}

@then('I should see an error message {string} during the title change')
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,28 +1,36 @@
Feature: Initiate a pathway

Scenario: I want to initialize a pathway
When I want to initialize a pathway with these data
| title | description | researchField |
| My Pathway | A test pathway | biology |
Then I should receive the attributes of the pathway
| title | description | researchField |
| My Pathway | A test pathway | biology |
# Scenario: I want to initialize a pathway
# When I want to initialize a pathway with these data
# | title | description | researchField |
# | My Pathway | A test pathway | biology |
# Then I should receive the attributes of the pathway
# | title | description | researchField |
# | My Pathway | A test pathway | biology |

Scenario: I want to initialize a pathway with an empty title
When I want to initialize a pathway with these data
| title | description | researchField |
| | A test pathway | biology |
Then I should see an error message "Title is required" during initialization of the pathway
# Scenario: When I initiliaze a pathway, an event should be emitted
# When I want to initialize a pathway with these data
# | title | description | researchField |
# | My Pathway | A test pathway | biology |
# Then it should emitted an event "PathwayInitialized" with the attributes of the pathway
# | title | description | researchField |
# | My Pathway | A test pathway | biology |

Scenario: I want to initialize a pathway with an empty description
When I want to initialize a pathway with these data
| title | description | researchField |
| My Pathway | | biology |
Then I should see an error message "Description is required" during initialization of the pathway
# Scenario: I want to initialize a pathway with an empty title
# When I want to initialize a pathway with these data
# | title | description | researchField |
# | | A test pathway | biology |
# Then I should see an error message "Title is required" during initialization of the pathway

# Scenario: I want to initialize a pathway with an empty description
# When I want to initialize a pathway with these data
# | title | description | researchField |
# | My Pathway | | biology |
# Then I should see an error message "Description is required" during initialization of the pathway

Scenario: I want to initialize a pathway with an empty research field
When I want to initialize a pathway with these data
| title | description | researchField |
| My Pathway | A test pathway | |
Then I should see an error message "Research field is required" during initialization of the pathway

# Scenario: I want to initialize a pathway with an empty research field
# When I want to initialize a pathway with these data
# | title | description | researchField |
# | My Pathway | A test pathway | |
# Then I should see an error message "Research field is required" during initialization of the pathway
Loading

0 comments on commit 807da0d

Please sign in to comment.