mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-12-06 17:52:16 +00:00
Test deduplication of members created during an import
This commit is contained in:
@@ -219,6 +219,23 @@ class TimeEntryDeduplicatorTest extends TestCase
|
||||
$this->assertSame([false, true], $results);
|
||||
}
|
||||
|
||||
public function test_does_not_claim_time_entry_of_member_created_after_the_members_were_loaded(): void
|
||||
{
|
||||
// Arrange
|
||||
$deduplicator = new TimeEntryDeduplicator($this->organization->getKey());
|
||||
$deduplicator->claimExisting($this->makeTimeEntry());
|
||||
$newMember = Member::factory()->forOrganization($this->organization)->create();
|
||||
|
||||
// Act
|
||||
$first = $deduplicator->claimExisting($this->makeTimeEntry(attributes: ['member_id' => $newMember->getKey()]));
|
||||
$this->makeTimeEntry(attributes: ['member_id' => $newMember->getKey()])->save();
|
||||
$second = $deduplicator->claimExisting($this->makeTimeEntry(attributes: ['member_id' => $newMember->getKey()]));
|
||||
|
||||
// Assert
|
||||
$this->assertFalse($first);
|
||||
$this->assertFalse($second);
|
||||
}
|
||||
|
||||
public function test_matches_time_entries_of_members_with_the_same_email(): void
|
||||
{
|
||||
// Arrange
|
||||
|
||||
Reference in New Issue
Block a user