Changeset 0.37.18 (#230)
Co-authored-by: gobha <jasafpro@gmail.com> Co-committed-by: gobha <jasafpro@gmail.com>
This commit is contained in:
@@ -131,6 +131,16 @@
|
||||
}
|
||||
});
|
||||
|
||||
// ── Files with origin filter (v0.37.18) ──
|
||||
|
||||
await T.test('channels', 'files', 'sw.api.channels.files(id, {origin})', {
|
||||
sdk: function () { return sw.api.channels.files(channelId, { origin: 'tool_output' }); },
|
||||
raw: { method: 'GET', path: '/channels/' + channelId + '/files?origin=tool_output' },
|
||||
validate: function (r) {
|
||||
T.assert(typeof r === 'object' || Array.isArray(r), 'expected object or array');
|
||||
}
|
||||
});
|
||||
|
||||
// ── Participants ──
|
||||
|
||||
await T.test('channels', 'participants', 'sw.api.channels.participants(id)', {
|
||||
|
||||
@@ -24,6 +24,31 @@
|
||||
validate: function (r) { var arr = T.unwrapList(r); T.assert(arr.length >= 0, 'expected list'); }
|
||||
});
|
||||
|
||||
// ── GetDefault (v0.37.18) ──
|
||||
|
||||
var defaultWsId = null;
|
||||
|
||||
await T.test('workspaces', 'getDefault', 'sw.api.workspaces.getDefault()', {
|
||||
sdk: function () { return sw.api.workspaces.getDefault(); },
|
||||
raw: { method: 'GET', path: '/workspaces/default' },
|
||||
validate: function (r) {
|
||||
T.assertShape(r, T.S.workspace, 'workspace');
|
||||
T.assert(r.owner_type === 'user', 'expected owner_type=user');
|
||||
T.assert(r.owner_id === userId, 'expected owner_id=current user');
|
||||
defaultWsId = r.id;
|
||||
}
|
||||
});
|
||||
|
||||
// ── GetDefault idempotent ──
|
||||
|
||||
await T.test('workspaces', 'getDefault', 'sw.api.workspaces.getDefault() idempotent', {
|
||||
sdk: function () { return sw.api.workspaces.getDefault(); },
|
||||
raw: { method: 'GET', path: '/workspaces/default' },
|
||||
validate: function (r) {
|
||||
T.assert(r.id === defaultWsId, 'expected same workspace on second call');
|
||||
}
|
||||
});
|
||||
|
||||
// ── Create ──
|
||||
|
||||
await T.test('workspaces', 'crud', 'sw.api.workspaces.create()', {
|
||||
|
||||
Reference in New Issue
Block a user