mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-19 08:50:29 +00:00
Change the event name to SHUTTLE_WILL_ARRIVE_AT_STOP, and emit it before the stop is updated
This commit is contained in:
@@ -712,12 +712,12 @@ describe.each(repositoryImplementations)('$name', (holder) => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("SHUTTLE_ARRIVED_AT_STOP event", () => {
|
||||
test("emits SHUTTLE_ARRIVED_AT_STOP event when shuttle arrives at a stop", async () => {
|
||||
describe("SHUTTLE_WILL_ARRIVE_AT_STOP event", () => {
|
||||
test("emits SHUTTLE_WILL_ARRIVE_AT_STOP event before shuttle arrives at a stop", async () => {
|
||||
const { route, systemId, stop1 } = await setupRouteAndOrderedStops();
|
||||
|
||||
const listener = jest.fn();
|
||||
repository.on(ShuttleRepositoryEvent.SHUTTLE_ARRIVED_AT_STOP, listener);
|
||||
repository.on(ShuttleRepositoryEvent.SHUTTLE_WILL_ARRIVE_AT_STOP, listener);
|
||||
|
||||
const shuttle = {
|
||||
id: "sh1",
|
||||
@@ -743,7 +743,7 @@ describe.each(repositoryImplementations)('$name', (holder) => {
|
||||
const { route, systemId } = await setupRouteAndOrderedStops();
|
||||
|
||||
const listener = jest.fn();
|
||||
repository.on(ShuttleRepositoryEvent.SHUTTLE_ARRIVED_AT_STOP, listener);
|
||||
repository.on(ShuttleRepositoryEvent.SHUTTLE_WILL_ARRIVE_AT_STOP, listener);
|
||||
|
||||
const shuttle = {
|
||||
id: "sh1",
|
||||
@@ -764,7 +764,7 @@ describe.each(repositoryImplementations)('$name', (holder) => {
|
||||
const { route, systemId, stop1, stop2 } = await setupRouteAndOrderedStops();
|
||||
|
||||
const listener = jest.fn();
|
||||
repository.on(ShuttleRepositoryEvent.SHUTTLE_ARRIVED_AT_STOP, listener);
|
||||
repository.on(ShuttleRepositoryEvent.SHUTTLE_WILL_ARRIVE_AT_STOP, listener);
|
||||
|
||||
const shuttle = {
|
||||
id: "sh1",
|
||||
|
||||
Reference in New Issue
Block a user