feat: collection runner (#3600)
Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com> Co-authored-by: nivedin <nivedinp@gmail.com>
This commit is contained in:
@@ -79,7 +79,7 @@ export const WORKSPACE_DEEPLY_NESTED_COLLECTIONS_WITH_AUTH_HEADERS_MOCK: Workspa
|
||||
collectionID: "clx1ldkzs005t10f8rp5u60q7",
|
||||
teamID: "clws3hg58000011o8h07glsb1",
|
||||
title: "RequestA",
|
||||
request: `{"v":"${RESTReqSchemaVersion}","id":"clpttpdq00003qp16kut6doqv","auth":{"authType":"inherit","authActive":true},"body":{"body":null,"contentType":null},"name":"RequestA","method":"GET","params":[],"headers":[],"endpoint":"https://echo.hoppscotch.io","testScript":"pw.test(\\"Correctly inherits auth and headers from the root collection\\", ()=> {\\n pw.expect(pw.response.body.headers[\\"x-test-header\\"]).toBe(\\"Set at root collection\\");\\n pw.expect(pw.response.body.headers[\\"authorization\\"]).toBe(\\"Bearer BearerToken\\");\\n});","preRequestScript":"","requestVariables":[]}`,
|
||||
request: `{"v":"${RESTReqSchemaVersion}","id":"clpttpdq00003qp16kut6doqv","auth":{"authType":"inherit","authActive":true},"body":{"body":null,"contentType":null},"name":"RequestA","method":"GET","params":[],"headers":[],"endpoint":"https://echo.hoppscotch.io","testScript":"pw.test(\\"Correctly inherits auth and headers from the root collection\\", ()=> {\\n pw.expect(pw.response.body.headers[\\"x-test-header\\"]).toBe(\\"Set at root collection\\");\\n pw.expect(pw.response.body.headers[\\"authorization\\"]).toBe(\\"Bearer BearerToken\\");\\n});","preRequestScript":"","requestVariables":[],"responses":{}}`,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -233,6 +233,7 @@ export const TRANSFORMED_DEEPLY_NESTED_COLLECTIONS_WITH_AUTH_HEADERS_MOCK: HoppC
|
||||
'pw.test("Correctly inherits auth and headers from the root collection", ()=> {\n pw.expect(pw.response.body.headers["x-test-header"]).toBe("Set at root collection");\n pw.expect(pw.response.body.headers["authorization"]).toBe("Bearer BearerToken");\n});',
|
||||
preRequestScript: "",
|
||||
requestVariables: [],
|
||||
responses: {},
|
||||
},
|
||||
],
|
||||
auth: {
|
||||
|
||||
@@ -31,12 +31,14 @@ const migrateCollections = (collections: unknown[]): HoppCollection[] => {
|
||||
);
|
||||
}
|
||||
|
||||
return collectionSchemaParsedResult.data.map((collection) => {
|
||||
return {
|
||||
...collection,
|
||||
folders: migrateCollections(collection.folders),
|
||||
};
|
||||
});
|
||||
return collectionSchemaParsedResult.data.map(
|
||||
({ _ref_id, folders, ...rest }) => {
|
||||
return {
|
||||
...rest,
|
||||
folders: migrateCollections(folders),
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
describe("workspace-access", () => {
|
||||
|
||||
Reference in New Issue
Block a user