-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(web, connections): filter out paused clusters; cleanup connection…
…s on plugin deactivate COMPASS-8510 CLOUDP-284226 (#6500) * fix(web, connections): filter out paused clusters; cleanup connections on plugin deactivate * chore(connections): fix test
- Loading branch information
1 parent
206341c
commit 8512aa7
Showing
5 changed files
with
62 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from 'react'; | ||
import { | ||
createDefaultConnectionInfo, | ||
render, | ||
} from '@mongodb-js/testing-library-compass'; | ||
import { expect } from 'chai'; | ||
|
||
describe('CompassConnections', function () { | ||
it('cleans-up connections when unmounted', async function () { | ||
const conn1 = createDefaultConnectionInfo(); | ||
const conn2 = createDefaultConnectionInfo(); | ||
|
||
const result = render( | ||
<div> | ||
{/* it's a bit weird, but testing-library-compass already renders CompassConnections for us */} | ||
</div>, | ||
{ connections: [conn1, conn2] } | ||
); | ||
|
||
await result.connectionsStore.actions.connect(conn1); | ||
|
||
expect( | ||
result.connectionsStore.getState().connections.byId[conn1.id] | ||
).to.have.property('status', 'connected'); | ||
|
||
result.unmount(); | ||
|
||
expect( | ||
result.connectionsStore.getState().connections.byId[conn1.id] | ||
).to.have.property('status', 'disconnected'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters