update naming of classes and tests

This commit is contained in:
2025-03-24 09:20:10 -07:00
parent 135a294e5d
commit 619ef9a27f
8 changed files with 26 additions and 26 deletions

View File

@@ -2094,9 +2094,9 @@ export const fetchSystemDataSuccessfulResponse = {
"logo": 1,
"goRoutePlannerEnabled": "0",
"goColor": null,
"goSupportEmail": "transit.services@pepperdine.edu",
"goSupportEmail": "transit.schedulers@pepperdine.edu",
"goAuthenticationType": "0",
"email": "transit.services@pepperdine.edu"
"email": "transit.schedulers@pepperdine.edu"
},
{
"fullname": "Perimeter Summit Shuttle",
@@ -3347,4 +3347,4 @@ export const fetchSystemDataSuccessfulResponse = {
"fromCache": 1,
"myip": "206.211.154.147"
}
};
};

View File

@@ -1,9 +1,9 @@
import { beforeEach, describe, expect, it, jest } from "@jest/globals";
import { NotificationService } from "../../src/services/NotificationService";
import { UnoptimizedInMemoryRepository } from "../../src/repositories/UnoptimizedInMemoryRepository";
import { ETANotificationScheduler } from "../../../src/notifications/schedulers/ETANotificationScheduler";
import { UnoptimizedInMemoryRepository } from "../../../src/repositories/UnoptimizedInMemoryRepository";
import http2 from "http2";
import { IEta, IShuttle, IStop } from "../../src/entities/entities";
import { addMockShuttleToRepository, addMockStopToRepository } from "../testHelpers/repositorySetupHelpers";
import { IEta, IShuttle, IStop } from "../../../src/entities/entities";
import { addMockShuttleToRepository, addMockStopToRepository } from "../../testHelpers/repositorySetupHelpers";
import EventEmitter = require("node:events");
jest.mock("http2");
@@ -55,13 +55,13 @@ function mockHttp2Connect(status: number) {
(http2.connect as jest.Mock) = jest.fn(() => new MockClient());
}
describe("NotificationService", () => {
describe("ETANotificationScheduler", () => {
let repository: UnoptimizedInMemoryRepository
let notificationService: NotificationService;
let notificationService: ETANotificationScheduler;
beforeEach(() => {
repository = new UnoptimizedInMemoryRepository();
notificationService = new NotificationService(repository);
notificationService = new ETANotificationScheduler(repository);
// Ensure that tests don't hit the server
process.env = {
@@ -192,7 +192,7 @@ describe("NotificationService", () => {
it('should return the production URL when APNS_IS_PRODUCTION is set to "1"', () => {
process.env.APNS_IS_PRODUCTION = "1";
const deviceId = 'testDeviceId';
const result = NotificationService.getAPNsFullUrlToUse(deviceId);
const result = ETANotificationScheduler.getAPNsFullUrlToUse(deviceId);
const { fullUrl, host, path } = result;
expect(fullUrl).toBe(`https://api.push.apple.com/3/device/${deviceId}`);
@@ -203,7 +203,7 @@ describe("NotificationService", () => {
it('should return the sandbox URL when APNS_IS_PRODUCTION is set to something other than 1', () => {
process.env.APNS_IS_PRODUCTION = "0";
const deviceId = 'testDeviceId';
const result = NotificationService.getAPNsFullUrlToUse(deviceId);
const result = ETANotificationScheduler.getAPNsFullUrlToUse(deviceId);
const { fullUrl, host, path } = result;
expect(fullUrl).toBe(`https://api.development.push.apple.com/3/device/${deviceId}`);

View File

@@ -2,7 +2,7 @@ import { describe, expect, it } from "@jest/globals";
import { generateMockSystems } from "../testHelpers/mockDataGenerators";
import { setupTestServerContext, setupTestServerHolder } from "../testHelpers/apolloTestServerHelpers";
import assert = require("node:assert");
import { ScheduledNotificationData } from "../../src/services/NotificationService";
import { ScheduledNotificationData } from "../../src/notifications/schedulers/ETANotificationScheduler";
import { addMockShuttleToRepository, addMockStopToRepository } from "../testHelpers/repositorySetupHelpers";
// See Apollo documentation for integration test guide

View File

@@ -4,7 +4,7 @@ import { MergedResolvers } from "../../src/MergedResolvers";
import { UnoptimizedInMemoryRepository } from "../../src/repositories/UnoptimizedInMemoryRepository";
import { beforeEach } from "@jest/globals";
import { ServerContext } from "../../src/ServerContext";
import { NotificationService } from "../../src/services/NotificationService";
import { ETANotificationScheduler } from "../../src/notifications/schedulers/ETANotificationScheduler";
function setUpTestServer() {
@@ -26,7 +26,7 @@ export function setupTestServerContext() {
beforeEach(() => {
context.repository = new UnoptimizedInMemoryRepository();
context.notificationService = new NotificationService(context.repository);
context.notificationService = new ETANotificationScheduler(context.repository);
});
return context as ServerContext;