Skip to content

Commit

Permalink
fix: HotStandby test should check .connect not the object
Browse files Browse the repository at this point in the history
  • Loading branch information
olzzon committed Dec 16, 2024
1 parent 3729a39 commit 28b5609
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/connector/src/__tests__/OpenMediaHotStandby.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ describe('Hot Standby Feature', () => {
expect(secondary).toBeTruthy()

if (primary && secondary) {
expect(primary.getConnectedStatus()).toBe(true)
expect(secondary.getConnectedStatus()).toBe(true)
expect(primary.getConnectedStatus().connected).toBe(true)
expect(secondary.getConnectedStatus().connected).toBe(true)

// Verify heartbeat states
expect(primary.isHearbeatEnabled()).toBe(true)
Expand All @@ -145,7 +145,7 @@ describe('Hot Standby Feature', () => {
await discconnectPrimary()

// Verify primary is properly disconnected
expect(primary.getConnectedStatus()).toBe(false)
expect(primary.getConnectedStatus().connected).toBe(false)

// connect secondary
socketMocks.forEach((socket) => {
Expand Down Expand Up @@ -186,7 +186,7 @@ describe('Hot Standby Feature', () => {
await new Promise((resolve) => setTimeout(resolve, 100))

// Verify primary is properly disconnected
expect(primary.getConnectedStatus()).toBe(false)
expect(primary.getConnectedStatus().connected).toBe(false)

// Verify heartbeat states after primary disconnect and secondary connect
expect(primary.isHearbeatEnabled()).toBe(false)
Expand Down Expand Up @@ -218,7 +218,7 @@ describe('Hot Standby Feature', () => {
await discconnectPrimary()

// Verify state after primary disconnect
expect(primary.getConnectedStatus()).toBe(false)
expect(primary.getConnectedStatus().connected).toBe(false)

// Verify secondary heartbeats are enabled after primary disconnect
expect(primary.isHearbeatEnabled()).toBe(false)
Expand Down

0 comments on commit 28b5609

Please sign in to comment.