mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) updates from grist-core
This commit is contained in:
@@ -52,10 +52,11 @@ describe('WebhookPage', function () {
|
||||
'Name',
|
||||
'Memo',
|
||||
'Event Types',
|
||||
'URL',
|
||||
'Table',
|
||||
'Ready Column',
|
||||
'Filter for changes in these columns (semicolon-separated ids)',
|
||||
'Ready Column',
|
||||
'URL',
|
||||
'Header Authorization',
|
||||
'Webhook Id',
|
||||
'Enabled',
|
||||
'Status',
|
||||
@@ -81,7 +82,7 @@ describe('WebhookPage', function () {
|
||||
await gu.waitToPass(async () => {
|
||||
assert.equal(await getField(1, 'Webhook Id'), id);
|
||||
});
|
||||
// Now other fields like name, memo and watchColIds are persisted.
|
||||
// Now other fields like name, memo, watchColIds, and Header Auth are persisted.
|
||||
await setField(1, 'Name', 'Test Webhook');
|
||||
await setField(1, 'Memo', 'Test Memo');
|
||||
await setField(1, 'Filter for changes in these columns (semicolon-separated ids)', 'A; B');
|
||||
@@ -115,6 +116,27 @@ describe('WebhookPage', function () {
|
||||
assert.lengthOf((await docApi.getRows('Table2')).A, 0);
|
||||
});
|
||||
|
||||
it('can create webhook with persistant header authorization', async function () {
|
||||
// The webhook won't work because the header auth doesn't match the api key of the current test user.
|
||||
await openWebhookPage();
|
||||
await setField(1, 'Event Types', 'add\nupdate\n');
|
||||
await setField(1, 'URL', `http://${host}/api/docs/${doc.id}/tables/Table2/records?flat=1`);
|
||||
await setField(1, 'Table', 'Table1');
|
||||
await gu.waitForServer();
|
||||
await driver.navigate().refresh();
|
||||
await waitForWebhookPage();
|
||||
await setField(1, 'Header Authorization', 'Bearer 1234');
|
||||
await gu.waitForServer();
|
||||
await driver.navigate().refresh();
|
||||
await waitForWebhookPage();
|
||||
await gu.waitToPass(async () => {
|
||||
assert.equal(await getField(1, 'Header Authorization'), 'Bearer 1234');
|
||||
});
|
||||
await gu.getDetailCell({col:'Header Authorization', rowNum: 1}).click();
|
||||
await gu.enterCell(Key.DELETE, Key.ENTER);
|
||||
await gu.waitForServer();
|
||||
});
|
||||
|
||||
it('can create two webhooks', async function () {
|
||||
await openWebhookPage();
|
||||
await setField(1, 'Event Types', 'add\nupdate\n');
|
||||
|
||||
@@ -13,7 +13,7 @@ import {normalizeEmail} from 'app/common/emails';
|
||||
import {UserProfile} from 'app/common/LoginSessionAPI';
|
||||
import {BehavioralPrompt, UserPrefs, WelcomePopup} from 'app/common/Prefs';
|
||||
import {DocWorkerAPI, UserAPI, UserAPIImpl} from 'app/common/UserAPI';
|
||||
import {HomeDBManager} from 'app/gen-server/lib/HomeDBManager';
|
||||
import {HomeDBManager} from 'app/gen-server/lib/homedb/HomeDBManager';
|
||||
import {TestingHooksClient} from 'app/server/lib/TestingHooks';
|
||||
import EventEmitter = require('events');
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
* into a file whose path is printed when server starts.
|
||||
*/
|
||||
import {encodeUrl, IGristUrlState, parseSubdomain} from 'app/common/gristUrls';
|
||||
import {HomeDBManager} from 'app/gen-server/lib/HomeDBManager';
|
||||
import {HomeDBManager} from 'app/gen-server/lib/homedb/HomeDBManager';
|
||||
import log from 'app/server/lib/log';
|
||||
import {getAppRoot} from 'app/server/lib/places';
|
||||
import {makeGristConfig} from 'app/server/lib/sendAppPage';
|
||||
|
||||
Reference in New Issue
Block a user