Skip to content

Commit 11d0d56

Browse files
Fix asynchronous test at the cypress backoffice tests
Co-authored-by: David Matas <[email protected]>
1 parent e98713d commit 11d0d56

File tree

6 files changed

+9
-7
lines changed

6 files changed

+9
-7
lines changed

cypress.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2-
"baseUrl": "http://localhost:8032",
3-
"video": false
2+
"video": false,
3+
"screenshotOnRunFailure": false
4+
45
}

cypress/integration/backoffice/courses.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe('Courses', () => {
2020
cy.get('form').submit();
2121

2222
cy.get('div[role="alert"]').contains(`Felicidades, el curso ${courseName} ha sido creado!`);
23-
// cy.contains(`Actualmente CodelyTV Pro cuenta con ${i} cursos.`);
23+
cy.contains(`Actualmente CodelyTV Pro cuenta con ${i} cursos.`);
2424
}
2525
});
2626
});

cypress/start.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import app from '../src/apps/backoffice/frontend/app';
22
import cypress from 'cypress';
33
import { Server } from 'http';
4+
import cypressConfig from '../cypress.json';
45

56
async function run() {
67
const server = await startServer();
@@ -28,8 +29,8 @@ async function runCypress() {
2829
browser: 'chrome',
2930
headless: true,
3031
config: {
32+
...cypressConfig,
3133
baseUrl: `http://localhost:${app.get('port')}`,
32-
video: false
3334
}
3435
});
3536
}

src/Contexts/Mooc/Courses/application/CourseCreator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ export class CourseCreator {
2929
);
3030

3131
await this.repository.save(course);
32-
this.eventBus.publish(course.pullDomainEvents());
32+
await this.eventBus.publish(course.pullDomainEvents());
3333
}
3434
}

src/Contexts/Mooc/CoursesCounter/application/Increment/CoursesCounterIncrementer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class CoursesCounterIncrementer {
1414
counter.increment(courseId);
1515

1616
await this.repository.save(counter);
17-
this.bus.publish(counter.pullDomainEvents());
17+
await this.bus.publish(counter.pullDomainEvents());
1818
}
1919
}
2020

src/apps/backoffice/frontend/config/dependency-injection/Shared/application.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ services:
1010
arguments: ['mooc']
1111

1212
Shared.EventBus:
13-
class: ../../../../../../Contexts/Shared/infrastructure/EventBus/InMemoryAsyncEventBus
13+
class: ../../../../../../Contexts/Shared/infrastructure/EventBus/InMemorySyncEventBus
1414
arguments: []
1515

1616
Shared.QueryBus:

0 commit comments

Comments
 (0)