mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Fix for tests failures
Summary: - DocApi test for Allowed Origin was using a home server endpoint - Fixing waitForServer, as gristApp can be unavailable for a moment when browser is refreshed - Fixing MergedOrgs tests typing issue Test Plan: Updated Reviewers: cyprien, paulfitz Reviewed By: cyprien, paulfitz Subscribers: paulfitz Differential Revision: https://phab.getgrist.com/D3648
This commit is contained in:
@@ -2794,7 +2794,7 @@ function testDocApi() {
|
||||
describe("Allowed Origin", () => {
|
||||
it('should allow only example.com', async () => {
|
||||
async function checkOrigin(origin: string, status: number, error?: string) {
|
||||
const resp = await axios.get(`${serverUrl}/api/docs/${docIds.Timesheets}/`,
|
||||
const resp = await axios.get(`${serverUrl}/api/docs/${docIds.Timesheets}/tables/Table1/data`,
|
||||
{...chimpy, headers: {...chimpy.headers, "Origin": origin}}
|
||||
);
|
||||
error && assert.deepEqual(resp.data, {error});
|
||||
@@ -2805,8 +2805,8 @@ function testDocApi() {
|
||||
await checkOrigin("https://bad.com/example.com/toto", 500, "Unrecognized origin");
|
||||
await checkOrigin("https://example.com/path", 200);
|
||||
await checkOrigin("https://good.example.com/toto", 200);
|
||||
})
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
// PLEASE ADD MORE TESTS HERE
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user