mirror of
https://github.com/got-feedBack/feedBack.git
synced 2026-10-04 03:57:54 +00:00
Renames across the entire codebase: - slopsmith/Slopsmith/SLOPSMITH/SlopSmith -> feedBack/FeedBack/FEEDBACK/FeedBack - byron/Byron/Byrongamatos -> got-feedBack/got-feedBack/got-feedBack - /home/byron/ -> /opt/got-feedBack/ - byron@ougsoft.com -> hi@got-feedBack.org - github.com/byrongamatos/ -> github.com/got-feedback/ - com.byron. -> com.got-feedback. - SLOPSMITH_ env vars -> FEEDBACK_ with backward-compat fallback - Protocol/storage strings migrated with read-old/write-new pattern - window.slopsmith JS API -> window.feedBack (canonical) + backward-compat alias Refs: #rename-slopsmith
19 lines
1.3 KiB
JavaScript
19 lines
1.3 KiB
JavaScript
const { test } = require('node:test');
|
|
const assert = require('node:assert/strict');
|
|
const { loadCapabilities } = require('./capabilities_test_harness');
|
|
|
|
test('multi-provider participants use deterministic order without duplicate-owner conflict', async () => {
|
|
const window = loadCapabilities();
|
|
const api = window.feedBack.capabilities;
|
|
const calls = [];
|
|
api.registerParticipant('provider_b', { 'shared-viz': { roles: ['owner', 'provider'], ownership: 'multi-provider', commands: ['register-provider'], order: { after: ['provider_a'] }, handlers: { 'register-provider': () => { calls.push('b'); return { outcome: 'passed' }; } }, runtime: true } });
|
|
api.registerParticipant('provider_a', { 'shared-viz': { roles: ['owner', 'provider'], ownership: 'multi-provider', commands: ['register-provider'], handlers: { 'register-provider': () => { calls.push('a'); return { outcome: 'handled' }; } }, runtime: true } });
|
|
|
|
const inspection = api.inspect('shared-viz');
|
|
const result = await api.dispatch({ capability: 'shared-viz', command: 'register-provider', source: 'test' });
|
|
|
|
assert.equal(inspection.conflicts.some(c => c.type === 'duplicate-owner'), false);
|
|
assert.equal(JSON.stringify(inspection.order.slice(-2)), JSON.stringify(['provider_a', 'provider_b']));
|
|
assert.equal(result.status, 'applied');
|
|
assert.equal(calls[0], 'a');
|
|
}); |