Skip to content

Commit

Permalink
fix(Git): issue with including unit-tests and protofiles (#8095)
Browse files Browse the repository at this point in the history
* expand type filtering for unit-tests and protofiles

* add mock route and websocket payload
  • Loading branch information
gatzjames authored Oct 17, 2024
1 parent 2ada790 commit db1e3b2
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion packages/insomnia/src/sync/git/ne-db-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,29 @@ export class NeDBClient {
];
} else if (type !== null && id === null) {
const workspace = await db.get(models.workspace.type, this._workspaceId);
let typeFilter = [type];

const modelTypesWithinFolders = [models.request.type, models.grpcRequest.type, models.webSocketRequest.type];
const typeFilter = modelTypesWithinFolders.includes(type) ? [models.requestGroup.type, type] : [type];
if (modelTypesWithinFolders.includes(type)) {
typeFilter = [models.requestGroup.type, type];
};

if (type === models.unitTest.type) {
typeFilter = [models.unitTestSuite.type, type];
}

if (type === models.protoFile.type) {
typeFilter = [models.protoDirectory.type, type];
}

if (type === models.mockRoute.type) {
typeFilter = [models.mockServer.type, type];
}

if (type === models.webSocketPayload.type) {
typeFilter = [models.webSocketRequest.type, type];
}

const children = await db.withDescendants(workspace, null, typeFilter);
docs = children.filter(d => d.type === type && !d.isPrivate);
} else {
Expand Down

0 comments on commit db1e3b2

Please sign in to comment.