Implemented BroadcastChannelService and FileTransferService
All checks were successful
Setup testing environment and test the code / build (push) Successful in 1m17s
All checks were successful
Setup testing environment and test the code / build (push) Successful in 1m17s
This commit is contained in:
29
tests/broadcastChannelService.test.ts
Normal file
29
tests/broadcastChannelService.test.ts
Normal 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()
|
||||
});
|
||||
})
|
||||
@@ -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)
|
||||
});
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user