piral-dashboard
Advanced tools
Comparing version 1.3.3-beta.6190 to 1.3.3-beta.6201
{ | ||
"name": "piral-dashboard", | ||
"version": "1.3.3-beta.6190", | ||
"version": "1.3.3-beta.6201", | ||
"description": "Plugin for creating a centralized dashboard in Piral.", | ||
@@ -66,6 +66,6 @@ "keywords": [ | ||
"@types/react-router-dom": "^5.1.6", | ||
"piral-core": "1.3.3-beta.6190", | ||
"piral-core": "1.3.3-beta.6201", | ||
"react": "^18.0.0" | ||
}, | ||
"gitHead": "dc3358f0e08b06acea2056b612f268334a8c49c8" | ||
"gitHead": "6e9f4e6f83514b5c38960ce015e073efc668f3d6" | ||
} |
@@ -0,6 +1,26 @@ | ||
/** | ||
* @vitest-environment jsdom | ||
*/ | ||
import create from 'zustand'; | ||
import { createListener } from 'piral-base'; | ||
import { createActions } from 'piral-core'; | ||
import { describe, it, expect, vitest } from 'vitest'; | ||
import { registerTile, unregisterTile } from './actions'; | ||
function createListener() { | ||
return { | ||
on: vitest.fn(), | ||
off: vitest.fn(), | ||
emit: vitest.fn(), | ||
}; | ||
} | ||
function createActions(state, listener) { | ||
return { | ||
...listener, | ||
state: state.getState(), | ||
dispatch(change) { | ||
state.setState(change(state.getState())); | ||
}, | ||
}; | ||
} | ||
describe('Dashboard Actions Module', () => { | ||
@@ -15,3 +35,3 @@ it('registerTile and unregisterTile', () => { | ||
})); | ||
const ctx = createActions(state, createListener({})); | ||
const ctx = createActions(state, createListener()); | ||
registerTile(ctx, 'foo', 10); | ||
@@ -18,0 +38,0 @@ expect((state.getState())).toEqual({ |
@@ -0,2 +1,6 @@ | ||
/** | ||
* @vitest-environment jsdom | ||
*/ | ||
import create from 'zustand'; | ||
import { describe, it, expect, vitest } from 'vitest'; | ||
import { createElement, FC } from 'react'; | ||
@@ -16,5 +20,5 @@ import { createDashboardApi } from './create'; | ||
context: { | ||
on: jest.fn(), | ||
off: jest.fn(), | ||
emit: jest.fn(), | ||
on: vitest.fn(), | ||
off: vitest.fn(), | ||
emit: vitest.fn(), | ||
defineActions() {}, | ||
@@ -50,4 +54,4 @@ converters: {}, | ||
const container = createMockContainer(); | ||
container.context.registerTile = jest.fn(); | ||
container.context.unregisterTile = jest.fn(); | ||
container.context.registerTile = vitest.fn(); | ||
container.context.unregisterTile = vitest.fn(); | ||
const api = createApi(container); | ||
@@ -64,4 +68,4 @@ api.registerTile('my-tile', StubComponent); | ||
const container = createMockContainer(); | ||
container.context.registerTile = jest.fn(); | ||
container.context.unregisterTile = jest.fn(); | ||
container.context.registerTile = vitest.fn(); | ||
container.context.unregisterTile = vitest.fn(); | ||
const api = createApi(container); | ||
@@ -78,4 +82,4 @@ const dispose = api.registerTile('my-tile', StubComponent); | ||
const container = createMockContainer(); | ||
container.context.registerTile = jest.fn(); | ||
container.context.unregisterTile = jest.fn(); | ||
container.context.registerTile = vitest.fn(); | ||
container.context.unregisterTile = vitest.fn(); | ||
const api = createApi(container); | ||
@@ -82,0 +86,0 @@ const dispose = api.registerTile(StubComponent); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
68828
1335