Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jshah4517 committed Mar 9, 2024
1 parent b6d55b8 commit 7720f42
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
9 changes: 6 additions & 3 deletions tests/Functional/Controller/ChannelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ public function testUnsubscribeGuardedChannel(): void
public function testUnsubscribeChannelNotFound(): void
{
$this->postAjax(route('supportpal.pollcast.unsubscribe'), ['channel_name' => 'fake-channel'])
->assertStatus(404);
->assertStatus(200)
->assertJson([false]);
}

public function testUnsubscribeMemberNotFound(): void
Expand All @@ -139,7 +140,8 @@ public function testUnsubscribeMemberNotFound(): void
$this->setupChannel($channelName);

$this->postAjax(route('supportpal.pollcast.unsubscribe'), ['channel_name' => $channelName])
->assertStatus(404);
->assertStatus(200)
->assertJson([false]);
}

public function testUnsubscribeMemberDifferentSocketId(): void
Expand All @@ -150,7 +152,8 @@ public function testUnsubscribeMemberDifferentSocketId(): void
Member::factory()->create(['channel_id' => $channel->id]);

$this->postAjax(route('supportpal.pollcast.unsubscribe'), ['channel_name' => $channelName])
->assertStatus(404);
->assertStatus(200)
->assertJson([false]);
}

/**
Expand Down
3 changes: 2 additions & 1 deletion tests/Functional/Controller/PublishTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ public function testPublishChannelNotFound(): void
'event' => 'test-event',
'data' => ['user_id' => 1],
])
->assertStatus(404);
->assertStatus(200)
->assertJson([false]);
}

public function testPublishValidation(): void
Expand Down
3 changes: 2 additions & 1 deletion tests/Functional/Controller/SubscriptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ public function testMessagesMemberNotFound(): void
'channels' => ['fake-channel'],
'time' => Carbon::now()->toDateTimeString('microsecond'),
])
->assertStatus(404);
->assertStatus(200)
->assertJson(['status' => 'error']);
}

public function testMessagesValidation(): void
Expand Down

0 comments on commit 7720f42

Please sign in to comment.