Implemented BroadcastChannelService and FileTransferService
All checks were successful
Setup testing environment and test the code / build (push) Successful in 1m17s

This commit is contained in:
2026-04-08 08:46:16 +02:00
parent e6798b4be8
commit a9322e3454
10 changed files with 428 additions and 3 deletions

View File

@@ -0,0 +1,29 @@
import {describe, expect, it} from "vitest";
import {BroadcastChannelService} from "../src/services/broadcastChannelService";
const BRC_CHAN_SERVICE_TESTING_NETWORK_ID = "000000000000000000000000"
const BRC_CHAN_SERVICE_TESTING_USER_ID = "000000000000000000000000"
const BRC_CHAN_SERVICE_TESTING_CHANNEL_ID = "333333333333333333333333"
const BRC_CHAN_SERVICE_TESTING_TOKEN = "testingToken"
const BRC_CHAN_SERVICE_TESTING_CATEGORY_ID = "111111111111111111111111"
describe("BroadcastChannelService Integration Testing", () => {
const service = new BroadcastChannelService(
BRC_CHAN_SERVICE_TESTING_TOKEN,
BRC_CHAN_SERVICE_TESTING_USER_ID,
BRC_CHAN_SERVICE_TESTING_NETWORK_ID,
BRC_CHAN_SERVICE_TESTING_CATEGORY_ID,
BRC_CHAN_SERVICE_TESTING_CHANNEL_ID,
(action, data) => {}
)
it('should create a new server and fetch it', async () => {
await service.createServer()
const registry = await service.getData()
expect(registry.status).toBe("idling")
});
it('should join ws room', async () => {
await service.joinWebSocketRoom()
});
})

View File

@@ -74,7 +74,7 @@ describe("NetworkService Integration Testing", () => {
});
it('should create rank', async () => {
const rankName = faker.internet.displayName()
const rankName = faker.internet.displayName().substring(0, 10)
const rank = await service.createRank(rankName, <RGB>{r: 0, g: 0, b: 0}, null)
expect(rank.name).toBe(rankName)
});

View File

@@ -24,7 +24,7 @@ describe("PictureService Integration Test", () => {
});
it('should create an album', async () => {
const albumName = faker.internet.displayName()
const albumName = faker.internet.displayName().substring(0, 10)
await service.createAlbum(albumName)
const uploads = await service.get()
expect(uploads.pictures[1].name).toBe(albumName)