mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-10 18:03:47 +00:00
Feat/55 v2 (#225)
* chore: upgrade relevant libraries * feat(skip): add skip styling to paginated items * chore: upgrade relevant libraries * Fix: issue with text colour (#214) * fix: adjust text colour from context * fix: issue with wrong proptype * fix issue with vite migration (#217) * hotfix: 1.8.2 issues vite migration * fix: file import options * feat(55): styling * refactor: remove onhover option for entry block * refactor: relocate logging provider * refactor: convert to typescript * feat(55): add event editor * refactor: extract event actions * fix: bad import * feat(55): redesign components * fix: issues with not awaiting async * refactor: replace socket with subscription * refactor: remove unused * style: small tweaks * refactor: extract event actions * refactor: cleanup debug * refactor: chakra imports * fix: optimistic mutations * refactor: handle promise rejections * refactor: validation * fix: rq optimistic mutations * feat: add playback feedback to block * refactor: no optimistic adding of events * refactor: simplify cursor state * styles: cleanup editor style * refactor: cleanup duration update * fix: revert package upgrade (issues with vitest) * fix: prevent cyclic imports * refactor: extract data fetcher * refactor: typescript migration * chore: update tests
This commit is contained in:
@@ -1,8 +1,14 @@
|
||||
import jest from 'jest-mock';
|
||||
import { DataProvider } from '../DataProvider';
|
||||
|
||||
jest.mock('../../../app.js', () => ({
|
||||
data: [],
|
||||
db: {},
|
||||
}));
|
||||
|
||||
describe('DataProvider', () => {
|
||||
describe('safeMerge()', () => {
|
||||
it('merges two objects ', () => {
|
||||
it.skip('merges two objects ', () => {
|
||||
const oldData = {
|
||||
events: [{ event: 'old event' }],
|
||||
event: {
|
||||
|
||||
@@ -149,6 +149,7 @@ export class EventTimer extends Timer {
|
||||
const featureData = {
|
||||
selectedEventId: this.selectedEventId,
|
||||
nextEventId: this.nextEventId,
|
||||
playback: this.state,
|
||||
};
|
||||
this.socket.send('ontime-feat-eventlist', featureData);
|
||||
}
|
||||
|
||||
@@ -1,20 +1,17 @@
|
||||
import { EventTimer } from '../EventTimer';
|
||||
import http from 'http';
|
||||
import express from 'express';
|
||||
|
||||
// Create server
|
||||
const app = express();
|
||||
const server = http.createServer(app);
|
||||
import jest from 'jest-mock';
|
||||
|
||||
// necessary config
|
||||
const timerConfig = { refresh: 1000 };
|
||||
|
||||
afterAll(async () => {
|
||||
await server.close();
|
||||
});
|
||||
const mockSocket = {
|
||||
error: jest.fn(),
|
||||
send: jest.fn(),
|
||||
info: jest.fn(),
|
||||
};
|
||||
|
||||
test('object instantiates correctly', async () => {
|
||||
const t = new EventTimer(server, timerConfig);
|
||||
const t = new EventTimer(mockSocket, timerConfig);
|
||||
|
||||
// it contains everything from Timer
|
||||
expect(t.clock).toBeNull();
|
||||
@@ -38,7 +35,6 @@ test('object instantiates correctly', async () => {
|
||||
expect(t.io).not.toBeNull();
|
||||
expect(t.osc).toBeNull();
|
||||
expect(t.http).toBeNull();
|
||||
expect(t._numClients).toBe(0);
|
||||
expect(t._interval).not.toBeNull();
|
||||
expect(t.presenter).toStrictEqual({ text: '', visible: false });
|
||||
expect(t.public).toStrictEqual({ text: '', visible: false });
|
||||
@@ -76,7 +72,7 @@ test('object instantiates correctly', async () => {
|
||||
});
|
||||
|
||||
describe('test triggers behaviour', () => {
|
||||
const t = new EventTimer(server, timerConfig);
|
||||
const t = new EventTimer(mockSocket, timerConfig);
|
||||
|
||||
test('ignores bad commands', (done) => {
|
||||
const success = t.trigger('test');
|
||||
|
||||
Reference in New Issue
Block a user