better system messages, display name relocation
This commit is contained in:
@@ -32,11 +32,13 @@ test('owner can create a mutation which is automatically approved and does not s
|
||||
// Verify chat messages (should NOT say "approved" or "Approved")
|
||||
$mutationChatMessages = $mutation->chat->messages;
|
||||
expect($mutationChatMessages)->toHaveCount(1);
|
||||
expect($mutationChatMessages->first()->content)->toBe("System: Entry was created by {$owner->name}.");
|
||||
expect($mutationChatMessages->first()->user_id)->toBeNull();
|
||||
expect($mutationChatMessages->first()->content)->toBe("Entry was created by <user:{$owner->id}>.");
|
||||
|
||||
$dynamicChatMessages = $dynamic->chat->messages;
|
||||
expect($dynamicChatMessages)->toHaveCount(1);
|
||||
expect($dynamicChatMessages->first()->content)->toBe("System: {$owner->name} added entry \"Direct point reward\" for +15 points on \"{$ledger->name}\" ledger.");
|
||||
expect($dynamicChatMessages->first()->user_id)->toBeNull();
|
||||
expect($dynamicChatMessages->first()->content)->toBe("<user:{$owner->id}> added entry \"Direct point reward\" for +15 points on \"{$ledger->name}\" ledger.");
|
||||
});
|
||||
|
||||
test('non-owner participant creates a suggestion which defaults to pending and says suggested', function () {
|
||||
@@ -68,11 +70,13 @@ test('non-owner participant creates a suggestion which defaults to pending and s
|
||||
// Verify chat messages
|
||||
$mutationChatMessages = $mutation->chat->messages;
|
||||
expect($mutationChatMessages)->toHaveCount(1);
|
||||
expect($mutationChatMessages->first()->content)->toBe("System: Suggestion was created by {$participant->name}.");
|
||||
expect($mutationChatMessages->first()->user_id)->toBeNull();
|
||||
expect($mutationChatMessages->first()->content)->toBe("Suggestion was created by <user:{$participant->id}>.");
|
||||
|
||||
$dynamicChatMessages = $dynamic->chat->messages;
|
||||
expect($dynamicChatMessages)->toHaveCount(1);
|
||||
expect($dynamicChatMessages->first()->content)->toBe("System: {$participant->name} suggested \"Suggested point reward\" for +10 points on \"{$ledger->name}\" ledger.");
|
||||
expect($dynamicChatMessages->first()->user_id)->toBeNull();
|
||||
expect($dynamicChatMessages->first()->content)->toBe("<user:{$participant->id}> suggested \"Suggested point reward\" for +10 points on \"{$ledger->name}\" ledger.");
|
||||
});
|
||||
|
||||
test('owner can approve a pending suggestion and it is updated and logged', function () {
|
||||
@@ -110,8 +114,10 @@ test('owner can approve a pending suggestion and it is updated and logged', func
|
||||
$mutationChatMessages = $mutation->chat->messages;
|
||||
// Note: one from boot created (empty or via seeder, but in our factory it starts with 0 messages if not manually logged,
|
||||
// actually our model booted hook creates the chat but doesn't log on boot, the update method creates 1 message)
|
||||
expect($mutationChatMessages->last()->content)->toBe("System: Suggestion was APPROVED by {$owner->name}.");
|
||||
expect($mutationChatMessages->last()->user_id)->toBeNull();
|
||||
expect($mutationChatMessages->last()->content)->toBe("Suggestion was APPROVED by <user:{$owner->id}>.");
|
||||
|
||||
$dynamicChatMessages = $dynamic->chat->messages;
|
||||
expect($dynamicChatMessages->last()->content)->toBe("System: {$owner->name} APPROVED the suggestion \"Polished dungeon floors\" for +20 points on \"{$ledger->name}\" ledger.");
|
||||
expect($dynamicChatMessages->last()->user_id)->toBeNull();
|
||||
expect($dynamicChatMessages->last()->content)->toBe("<user:{$owner->id}> APPROVED the suggestion \"Polished dungeon floors\" for +20 points on \"{$ledger->name}\" ledger.");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user