Skip to content

Commit

Permalink
Fix existing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kraenhansen committed Nov 7, 2024
1 parent 2405533 commit 40b2188
Showing 1 changed file with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ describe('useFilteredConnections', function () {
filterRegex: null,
fetchAllCollections: fetchAllCollectionsStub,
onDatabaseExpand: onDatabaseExpandStub,
excludeInactive: false,
},
});

Expand All @@ -155,6 +156,7 @@ describe('useFilteredConnections', function () {
filterRegex: null,
fetchAllCollections: fetchAllCollectionsStub,
onDatabaseExpand: onDatabaseExpandStub,
excludeInactive: false,
},
});

Expand All @@ -175,6 +177,7 @@ describe('useFilteredConnections', function () {
filterRegex: null,
fetchAllCollections: fetchAllCollectionsStub,
onDatabaseExpand: onDatabaseExpandStub,
excludeInactive: false,
},
});

Expand Down Expand Up @@ -206,6 +209,7 @@ describe('useFilteredConnections', function () {
filterRegex: null,
fetchAllCollections: fetchAllCollectionsStub,
onDatabaseExpand: onDatabaseExpandStub,
excludeInactive: false,
},
});

Expand Down Expand Up @@ -258,6 +262,7 @@ describe('useFilteredConnections', function () {
filterRegex: null,
fetchAllCollections: fetchAllCollectionsStub,
onDatabaseExpand: onDatabaseExpandStub,
excludeInactive: false,
},
});

Expand Down Expand Up @@ -294,6 +299,7 @@ describe('useFilteredConnections', function () {
filterRegex: null,
fetchAllCollections: fetchAllCollectionsStub,
onDatabaseExpand: onDatabaseExpandStub,
excludeInactive: false,
},
});

Expand Down Expand Up @@ -340,6 +346,7 @@ describe('useFilteredConnections', function () {
filterRegex: null,
fetchAllCollections: fetchAllCollectionsStub,
onDatabaseExpand: onDatabaseExpandStub,
excludeInactive: false,
},
});

Expand Down Expand Up @@ -373,6 +380,7 @@ describe('useFilteredConnections', function () {
filterRegex: null,
fetchAllCollections: fetchAllCollectionsStub,
onDatabaseExpand: onDatabaseExpandStub,
excludeInactive: false,
},
}
);
Expand Down Expand Up @@ -407,6 +415,7 @@ describe('useFilteredConnections', function () {
filterRegex: null,
fetchAllCollections: fetchAllCollectionsStub,
onDatabaseExpand: onDatabaseExpandStub,
excludeInactive: false,
});
// should remove the expanded state of connection 2
await waitFor(() => {
Expand All @@ -423,6 +432,7 @@ describe('useFilteredConnections', function () {
filterRegex: null,
fetchAllCollections: fetchAllCollectionsStub,
onDatabaseExpand: onDatabaseExpandStub,
excludeInactive: false,
});
await waitFor(() => {
expect(result.current.expanded).to.deep.equal({
Expand All @@ -445,6 +455,7 @@ describe('useFilteredConnections', function () {
filterRegex: new RegExp('_connection', 'i'), // match everything basically
fetchAllCollections: fetchAllCollectionsStub,
onDatabaseExpand: onDatabaseExpandStub,
excludeInactive: false,
},
}
);
Expand All @@ -460,6 +471,7 @@ describe('useFilteredConnections', function () {
filterRegex: new RegExp('disconnected_connection', 'i'), // match disconnected one
fetchAllCollections: fetchAllCollectionsStub,
onDatabaseExpand: onDatabaseExpandStub,
excludeInactive: false,
});
await waitFor(() => {
expect(result.current.filtered).to.be.deep.equal([
Expand All @@ -475,6 +487,7 @@ describe('useFilteredConnections', function () {
filterRegex: new RegExp('db_ready_1_1', 'i'), // match first database basically
fetchAllCollections: fetchAllCollectionsStub,
onDatabaseExpand: onDatabaseExpandStub,
excludeInactive: false,
},
});

Expand Down Expand Up @@ -515,6 +528,7 @@ describe('useFilteredConnections', function () {
filterRegex: new RegExp('Matching', 'i'), // this matches connection as well as database
fetchAllCollections: fetchAllCollectionsStub,
onDatabaseExpand: onDatabaseExpandStub,
excludeInactive: false,
},
});

Expand All @@ -532,6 +546,7 @@ describe('useFilteredConnections', function () {
filterRegex: new RegExp('coll_ready_2_1', 'i'), // match second db's collection
fetchAllCollections: fetchAllCollectionsStub,
onDatabaseExpand: onDatabaseExpandStub,
excludeInactive: false,
},
});

Expand Down Expand Up @@ -560,6 +575,7 @@ describe('useFilteredConnections', function () {
filterRegex: new RegExp('ready_2_1', 'i'), // this matches 1 database and 1 collection
fetchAllCollections: fetchAllCollectionsStub,
onDatabaseExpand: onDatabaseExpandStub,
excludeInactive: false,
},
});

Expand All @@ -578,6 +594,7 @@ describe('useFilteredConnections', function () {
filterRegex: new RegExp('coll_ready_1_1', 'i'),
fetchAllCollections: fetchAllCollectionsStub,
onDatabaseExpand: onDatabaseExpandStub,
excludeInactive: false,
},
});

Expand All @@ -599,9 +616,10 @@ describe('useFilteredConnections', function () {
{
initialProps: {
connections: mockSidebarConnections,
filterRegex: null,
filterRegex: null as RegExp | null,
fetchAllCollections: fetchAllCollectionsStub,
onDatabaseExpand: onDatabaseExpandStub,
excludeInactive: false,
},
}
);
Expand All @@ -620,6 +638,7 @@ describe('useFilteredConnections', function () {
filterRegex: new RegExp('coll_ready_1_1', 'i'),
fetchAllCollections: fetchAllCollectionsStub,
onDatabaseExpand: onDatabaseExpandStub,
excludeInactive: false,
});
await waitFor(() => {
expect(result.current.expanded).to.deep.equal({
Expand All @@ -640,9 +659,10 @@ describe('useFilteredConnections', function () {
{
initialProps: {
connections: mockSidebarConnections,
filterRegex: new RegExp('coll_ready_1_1', 'i'),
filterRegex: new RegExp('coll_ready_1_1', 'i') as RegExp | null,
fetchAllCollections: fetchAllCollectionsStub,
onDatabaseExpand: onDatabaseExpandStub,
excludeInactive: false,
},
}
);
Expand All @@ -661,6 +681,7 @@ describe('useFilteredConnections', function () {
filterRegex: null,
fetchAllCollections: fetchAllCollectionsStub,
onDatabaseExpand: onDatabaseExpandStub,
excludeInactive: false,
});
await waitFor(() => {
expect(result.current.expanded).to.deep.equal({
Expand All @@ -682,6 +703,7 @@ describe('useFilteredConnections', function () {
filterRegex: new RegExp('coll_ready_1_1', 'i'),
fetchAllCollections: fetchAllCollectionsStub,
onDatabaseExpand: onDatabaseExpandStub,
excludeInactive: false,
},
});

Expand Down Expand Up @@ -714,6 +736,7 @@ describe('useFilteredConnections', function () {
filterRegex: new RegExp('coll_ready_1_1', 'i'),
fetchAllCollections: fetchAllCollectionsStub,
onDatabaseExpand: onDatabaseExpandStub,
excludeInactive: false,
},
});

Expand Down Expand Up @@ -752,6 +775,7 @@ describe('useFilteredConnections', function () {
filterRegex: new RegExp('coll_ready_1_1', 'i'),
fetchAllCollections: fetchAllCollectionsStub,
onDatabaseExpand: onDatabaseExpandStub,
excludeInactive: false,
},
});

Expand Down

0 comments on commit 40b2188

Please sign in to comment.