Release 2.16.2
This commit is contained in:
1 parent
8ce8228091
commit
49df51d92f
32 files changed
+390
-172
No files matched your search
@@ -244,7 +244,7 @@ test('saved requests show visible full-width response trees with independent exp
|
||||
const html = renderEdit({ id: 42, name: 'Campaign', requests: [
|
||||
{ id: 43, name: 'Event', last_response_status: 200, last_response_json: '{"data":{"total":42}}' },
|
||||
{ id: 44, name: 'Donors', last_response_status: 200, last_response_json: '{"data":[{"name":"Donor"}]}' }
|
||||
] }, {}, '', { permissionKeys: ['api-sources.update'] });
|
||||
] }, {}, '', { permissionKeys: ['api-sources.update', 'api-sources.allow'] });
|
||||
assert.equal((html.match(/data-api-request-response/g) || []).length, 2);
|
||||
assert.equal((html.match(/data-json-toggle-expand-all/g) || []).length, 2);
|
||||
assert.equal((html.match(/data-json-toggle-collapse-all/g) || []).length, 2);
|
||||
@@ -253,6 +253,27 @@ test('saved requests show visible full-width response trees with independent exp
|
||||
assert.match(html, /HTTP 200/);
|
||||
assert.match(html, /data-api-request-title>Request - Event<\/h3>/);
|
||||
assert.match(html, /data-api-request-title>Request - Donors<\/h3>/);
|
||||
for (const id of [43, 44]) {
|
||||
assert.ok(html.includes('id="api-request-response-' + id + '"'));
|
||||
assert.ok(html.includes('data-manual-refresh-target="#api-request-response-' + id + '"'));
|
||||
}
|
||||
});
|
||||
|
||||
test('the Connection master toggle disables refresh actions without changing request switches', () => {
|
||||
const renderEdit = require('../src/web/routes/data-sources/api-sources/edit');
|
||||
const user = { permissionKeys: ['api-sources.update', 'api-sources.allow'] };
|
||||
const requests = [{ id: 43, name: 'Event', enabled: 1 }];
|
||||
const enabled = renderEdit({ id: 5, name: 'Tiltify', enabled: 1, requests }, {}, '', user);
|
||||
const disabled = renderEdit({ id: 5, name: 'Tiltify', enabled: 0, requests }, {}, '', user);
|
||||
assert.match(enabled, /form="api-source-toggle-form" data-async-data-source-toggle data-enabled="true"/);
|
||||
assert.match(disabled, /form="api-source-toggle-form" data-async-data-source-toggle data-enabled="false"/);
|
||||
assert.match(disabled, /data-request-field="enabled" checked/);
|
||||
assert.match(disabled, /data-source-item-enabled="true" disabled/);
|
||||
assert.match(disabled, /data-async-command><input type="hidden" name="data_source_action" value="toggle"/);
|
||||
for (const html of [enabled, disabled]) {
|
||||
assert.ok(html.indexOf('data-api-auth-test-url') < html.indexOf('data-async-data-source-toggle'));
|
||||
assert.ok(html.indexOf('data-async-data-source-toggle') < html.indexOf('data-api-request-add'));
|
||||
}
|
||||
});
|
||||
|
||||
test('connection diagnostics follow the tested section and can be dismissed and reopened', async () => {
|
||||
|
||||
Reference in new issue
Block a user