Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 7, 2026

Generated 28 test files covering previously untested classes and modules, following existing test patterns.

Coverage Added

Models & Relationships (6 tests)

  • AppliedCoupon, Discountable, Tax pivot models
  • Price meta model with currency formatting
  • Property and PropertyValue models

Drivers (8 tests)

  • Cart drivers: Cookie, Session, Null
  • Payment gateways: Cash, Manual, Transfer
  • Shipping: LocalPickup, base Driver

Business Logic (4 tests)

  • Traits: AsCustomer, AsOrder, HasPrices, HasProperties
  • Order calculations, coupon application, pricing

Infrastructure (10 tests)

  • Event listeners: ClearCookies, FormatBazarStubs, RefreshInventory
  • HTTP controllers: base Controller, GatewayController
  • Notifications: OrderDetails
  • Support: Countries, base Driver
  • Relations: custom Prices relation
  • Actions: SendOrderDetails

Test Structure

All tests follow repository conventions:

  • Extend Cone\Bazar\Tests\TestCase
  • Use Laravel factories and testing utilities
  • Standard setUp/tearDown patterns
  • Descriptive test_* method names
public function test_driver_queues_cookie_after_resolution(): void
{
    $cart = $this->driver->getModel();
    $queuedCookies = Cookie::getQueuedCookies();
    
    $this->assertSame('cart_id', $queuedCookies[0]->getName());
    $this->assertSame($cart->getKey(), $queuedCookies[0]->getValue());
}

Stats: 49 test files (previously 21), +1,950 lines of test code

Original prompt

Could you generate the missing tests based on the current test suite?


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 7, 2026 10:31
Copilot AI changed the title [WIP] Add missing tests to current test suite Add comprehensive test coverage for untested components Jan 7, 2026
Copilot AI requested a review from iamgergo January 7, 2026 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants