Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions Modules/Clients/Tests/Feature/ContactsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,14 @@ public function it_lists_contacts(): void
'gender' => 'female',
];

Contact::factory()->for($this->company)->create($payload);
$contact = Contact::factory()->for($this->company)->create($payload);

/* Act */
$component = Livewire::actingAs($this->user)
->test(ListContacts::class);

/* Assert */
$component
->assertSuccessful()
->assertSee('Jane Doe');
$this->assertDatabaseHas('contacts', $payload);
$component->assertCanSeeTableRecords([$contact]);
}
# endregion

Expand Down Expand Up @@ -85,7 +82,6 @@ public function it_creates_a_contact_through_a_modal(): void
->assertHasNoFormErrors();

/* Assert */
$component->assertSuccessful();

$this->assertDatabaseHas('contacts', $payload);
}
Expand Down Expand Up @@ -220,7 +216,6 @@ public function it_updates_a_contact_through_a_modal(): void

/* Assert */
$component
->assertSuccessful()
->assertHasNoErrors();

$this->assertDatabaseHas('contacts', $updatedData);
Expand Down Expand Up @@ -252,7 +247,6 @@ public function it_creates_a_contact(): void

/* Assert */
$component
->assertSuccessful()
->assertHasNoFormErrors();

$this->assertDatabaseHas('contacts', $payload);
Expand Down
8 changes: 1 addition & 7 deletions Modules/Clients/Tests/Feature/CustomersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public function it_lists_customers(): void
->test(ListRelations::class, ['tenant' => Str::lower($this->company->search_code)]);

/* Assert */
$component->assertSuccessful();

$this->assertDatabaseHas('relations', $payload);
}
Expand Down Expand Up @@ -82,7 +81,6 @@ public function it_creates_a_customer_through_a_modal(): void
->assertHasNoFormErrors();

/* Assert */
$component->assertSuccessful();

$this->assertDatabaseHas('relations', $payload);
}
Expand Down Expand Up @@ -236,8 +234,7 @@ public function it_updates_a_customer_through_a_modal(): void
->assertHasNoFormErrors();

/* Assert */
$component
->assertSuccessful();
$component;

$this->assertDatabaseHas(
'relations',
Expand Down Expand Up @@ -273,7 +270,6 @@ public function it_creates_a_customer(): void

/* Assert */
$component
->assertSuccessful()
->assertHasNoFormErrors();

$this->assertDatabaseHas('relations', $payload);
Expand Down Expand Up @@ -371,7 +367,6 @@ public function it_fails_to_create_without_required_registered_at(): void
#[Group('crud')]
public function it_deletes_a_customer(): void
{
$this->markTestIncomplete('foreign key contact');

/* Arrange */
$customer = Relation::factory()->for($this->company)->create([
Expand All @@ -392,7 +387,6 @@ public function it_deletes_a_customer(): void
#[Group('crud')]
public function it_fails_to_delete_customer_when_contact_attached(): void
{
$this->markTestIncomplete();

/* Arrange */
$customer = Relation::factory()->for($this->company)->create([
Expand Down
11 changes: 1 addition & 10 deletions Modules/Core/Tests/Feature/CompaniesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class CompaniesTest extends AbstractAdminPanelTestCase
* @payload ['name' => 'Acme LLC']
*/
#[Group('crud')]
public function it_lists_companies(): void
public function it_lists_companies_in_crud_section(): void
{
/* Arrange */
$company = Company::factory()->create(['name' => 'Acme LLC']);
Expand All @@ -33,7 +33,6 @@ public function it_lists_companies(): void
->test(ListCompanies::class);

/* Assert */
$component->assertSuccessful();

$this->assertDatabaseHas('companies', $company->toArray());
}
Expand All @@ -59,7 +58,6 @@ public function it_creates_a_company_through_a_modal(): void
->callMountedAction();

/* Assert */
$component->assertSuccessful();
$component->assertHasNoFormErrors();
$this->assertDatabaseHas('companies', $payload);
}
Expand Down Expand Up @@ -143,7 +141,6 @@ public function it_updates_a_company_through_a_modal(): void
->assertHasNoFormErrors();

/* Assert */
$component->assertSuccessful();
$this->assertDatabaseHas('companies', array_merge(
['id' => $company->id],
$updatedData
Expand Down Expand Up @@ -171,7 +168,6 @@ public function it_lists_companies(): void
->test(ListCompanies::class);

/* assert */
$component->assertSuccessful();

$this->assertDatabaseHas('companies', $company->toArray());
}
Expand All @@ -182,7 +178,6 @@ public function it_lists_companies(): void
#[Group('modals')]
public function it_creates_a_company_trough_a_modal(): void
{
$this->markTestIncomplete('need revisit, slug not generated');
/* arrange */
$payload = [
'search_code' => 'ROCKETCORP',
Expand All @@ -198,7 +193,6 @@ public function it_creates_a_company_trough_a_modal(): void
->callMountedAction();

/* assert */
$component->assertSuccessful();
$component->assertHasNoFormErrors();
$this->assertDatabaseHas('companies', $payload);
}
Expand Down Expand Up @@ -228,7 +222,6 @@ public function it_creates_a_company(): void

/* Assert */
$component
->assertSuccessful()
->assertHasNoErrors();

$this->assertDatabaseHas('companies', $payload);
Expand Down Expand Up @@ -297,7 +290,6 @@ public function it_updates_a_company(): void

/* Assert */
$component
->assertSuccessful()
->assertHasNoErrors();

$this->assertDatabaseHas('companies', $payload);
Expand All @@ -312,7 +304,6 @@ public function it_updates_a_company(): void
*/
public function it_deletes_a_company(): void
{
$this->markTestIncomplete('do not delete companies yet');

/* Arrange */
$company = Company::factory()->create([
Expand Down
6 changes: 1 addition & 5 deletions Modules/Core/Tests/Feature/EmailTemplatesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public function it_lists_email_templates(): void
->test(ListEmailTemplates::class);

/* Assert */
$component->assertSuccessful();

$this->assertDatabaseHas('email_templates', $template->toArray());
}
Expand Down Expand Up @@ -67,7 +66,6 @@ public function it_creates_an_email_template_through_a_modal(): void

/* Assert */
$component
->assertSuccessful()
->assertHasNoFormErrors();

$this->assertDatabaseHas('email_templates', $payload);
Expand Down Expand Up @@ -158,7 +156,6 @@ public function it_updates_an_email_template_through_a_modal(): void

/* Assert */
$component
->assertSuccessful()
->assertHasNoErrors();

$this->assertDatabaseHas('email_templates', $payload);
Expand Down Expand Up @@ -194,7 +191,7 @@ public function it_creates_an_email_template(): void
->fillForm($payload)
->call('create');

$component->assertSuccessful()->assertHasNoFormErrors();
$component->assertHasNoFormErrors();

$this->assertDatabaseHas('email_templates', array_merge(
$payload,
Expand Down Expand Up @@ -279,7 +276,6 @@ public function it_updates_an_email_template(): void

/* Assert */
$component
->assertSuccessful()
->assertHasNoErrors();

$this->assertDatabaseHas('email_templates', $payload);
Expand Down
2 changes: 0 additions & 2 deletions Modules/Core/Tests/Feature/NumberingPanelAccessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ public function it_allows_admin_to_assign_numbering_to_any_company(): void
}

#[Test]
#[Group('failing')]
public function it_restricts_company_panel_to_current_company_only(): void
{
/* Arrange */
Expand Down Expand Up @@ -124,7 +123,6 @@ public function it_prevents_company_user_from_changing_company_id(): void

// Attempting to update with different company_id should fail or be ignored
// In practice, this would be prevented by form validation or policy
$this->assertTrue(true); // Placeholder - actual enforcement is in Filament form
}

#[Test]
Expand Down
4 changes: 0 additions & 4 deletions Modules/Core/Tests/Feature/NumberingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public function it_lists_numberings(): void
->test(ListNumberings::class);

/* Assert */
$component->assertSuccessful();
$this->assertDatabaseHas('numbering', [
'id' => $numbering->id,
'type' => $numbering->type->value,
Expand Down Expand Up @@ -71,7 +70,6 @@ public function it_filters_numberings_by_current_company_id(): void
->test(ListNumberings::class);

/* Assert */
$component->assertSuccessful();
$component->assertCanSeeTableRecords([$ownNumbering]);
$component->assertCanNotSeeTableRecords([$otherNumbering]);
}
Expand Down Expand Up @@ -109,7 +107,6 @@ public function it_creates_a_numbering_scheme(): void

#[Test]
#[Group('crud')]
#[Group('failing')]
public function it_updates_a_numbering_scheme(): void
{
/* Arrange */
Expand Down Expand Up @@ -141,7 +138,6 @@ public function it_updates_a_numbering_scheme(): void

#[Test]
#[Group('crud')]
#[Group('failing')]
public function it_deletes_a_numbering_scheme(): void
{
/* Arrange */
Expand Down
9 changes: 0 additions & 9 deletions Modules/Core/Tests/Feature/ReportBuilderBlockEditTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public function it_looks_up_block_by_block_type(): void
$this->assertNotNull($foundBlock);
$this->assertEquals('company_header', $foundBlock->block_type);
$this->assertEquals('Company Header', $foundBlock->name);
$this->markTestIncomplete('Test implementation complete but marked incomplete as per requirements');
}

#[Test]
Expand Down Expand Up @@ -86,7 +85,6 @@ public function it_populates_form_with_block_data(): void
$this->assertEquals('details', $data['default_band']);
$this->assertTrue($data['is_active']);
$this->assertIsArray($data['config']);
$this->markTestIncomplete('Test implementation complete but marked incomplete as per requirements');
}

#[Test]
Expand All @@ -110,7 +108,6 @@ public function it_converts_width_enum_to_value_for_form(): void

/* Assert */
$this->assertEquals('two_thirds', $data['width']);
$this->markTestIncomplete('Test implementation complete but marked incomplete as per requirements');
}

#[Test]
Expand All @@ -136,7 +133,6 @@ public function it_provides_default_values_when_block_not_found(): void
$this->assertNull($block);
$this->assertEquals($blockType, $defaultData['block_type']);
$this->assertTrue($defaultData['is_active']);
$this->markTestIncomplete('Test implementation complete but marked incomplete as per requirements');
}

#[Test]
Expand Down Expand Up @@ -165,8 +161,6 @@ public function it_logs_block_data_for_debugging(): void
Log::info('Mounting block config with data:', $data);

/* Assert */
$this->assertTrue(true); // Log assertions are handled by shouldReceive
$this->markTestIncomplete('Test implementation complete but marked incomplete as per requirements');
}

#[Test]
Expand Down Expand Up @@ -206,7 +200,6 @@ public function it_handles_all_block_types_correctly(): void
$this->assertInstanceOf(ReportBlock::class, $block);
$this->assertContains($block->block_type, $blockTypes);
}
$this->markTestIncomplete('Test implementation complete but marked incomplete as per requirements');
}

#[Test]
Expand Down Expand Up @@ -234,7 +227,6 @@ public function it_preserves_config_array_when_editing(): void
$this->assertEquals($config, $data['config']);
$this->assertTrue($data['config']['show_vat_id']);
$this->assertEquals(10, $data['config']['font_size']);
$this->markTestIncomplete('Test implementation complete but marked incomplete as per requirements');
}

#[Test]
Expand All @@ -257,6 +249,5 @@ public function it_uses_slug_for_lookup_when_available(): void
$this->assertNotNull($foundByType);
$this->assertEquals($foundBySlug->id, $foundByType->id);
$this->assertEquals('slug_lookup_test', $foundBySlug->block_type);
$this->markTestIncomplete('Test implementation complete but marked incomplete as per requirements');
}
}
8 changes: 0 additions & 8 deletions Modules/Core/Tests/Feature/ReportBuilderBlockWidthTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public function it_renders_one_third_width_block_with_correct_grid_span(): void
/* Assert */
$this->assertEquals(4, $gridWidth);
$this->assertEquals(ReportBlockWidth::ONE_THIRD, $block->width);
$this->markTestIncomplete('Test implementation complete but marked incomplete as per requirements');
}

#[Test]
Expand All @@ -69,7 +68,6 @@ public function it_renders_half_width_block_with_correct_grid_span(): void
/* Assert */
$this->assertEquals(6, $gridWidth);
$this->assertEquals(ReportBlockWidth::HALF, $block->width);
$this->markTestIncomplete('Test implementation complete but marked incomplete as per requirements');
}

#[Test]
Expand All @@ -89,7 +87,6 @@ public function it_renders_two_thirds_width_block_with_correct_grid_span(): void
/* Assert */
$this->assertEquals(8, $gridWidth);
$this->assertEquals(ReportBlockWidth::TWO_THIRDS, $block->width);
$this->markTestIncomplete('Test implementation complete but marked incomplete as per requirements');
}

#[Test]
Expand All @@ -109,7 +106,6 @@ public function it_renders_full_width_block_with_correct_grid_span(): void
/* Assert */
$this->assertEquals(12, $gridWidth);
$this->assertEquals(ReportBlockWidth::FULL, $block->width);
$this->markTestIncomplete('Test implementation complete but marked incomplete as per requirements');
}

#[Test]
Expand Down Expand Up @@ -141,7 +137,6 @@ public function it_correctly_maps_block_widths_to_grid_columns_in_template(): vo

/* Assert */
$this->assertEquals([4, 6, 8, 12], $mappedWidths);
$this->markTestIncomplete('Test implementation complete but marked incomplete as per requirements');
}

#[Test]
Expand All @@ -161,7 +156,6 @@ public function it_handles_invoice_items_block_as_full_width(): void
/* Assert */
$this->assertEquals(12, $gridWidth);
$this->assertEquals(ReportBlockWidth::FULL, $block->width);
$this->markTestIncomplete('Test implementation complete but marked incomplete as per requirements');
}

#[Test]
Expand Down Expand Up @@ -189,7 +183,6 @@ public function it_applies_correct_css_grid_column_span_for_block_widths(): void
"Width {$testCase['width']->value} (grid: {$gridWidth}) should span {$testCase['expectedSpan']} columns"
);
}
$this->markTestIncomplete('Test implementation complete but marked incomplete as per requirements');
}

#[Test]
Expand All @@ -216,6 +209,5 @@ public function it_ensures_blocks_maintain_width_after_being_added_to_band(): vo
$this->assertEquals($initialWidth, $finalWidth);
$this->assertEquals($initialGridWidth, $finalGridWidth);
$this->assertEquals(8, $finalGridWidth);
$this->markTestIncomplete('Test implementation complete but marked incomplete as per requirements');
}
}
Loading