WorldCupOddsAdminViewTest.php 923 B

12345678910111213141516171819202122
  1. <?php
  2. namespace Tests\Unit;
  3. use PHPUnit\Framework\TestCase;
  4. class WorldCupOddsAdminViewTest extends TestCase
  5. {
  6. public function testOddsCellCanBeEditedInlineWithoutPageRefresh(): void
  7. {
  8. $view = file_get_contents(__DIR__ . '/../../resources/views/admin/world_cup/odds.blade.php');
  9. $this->assertContains('class="js-current-odds"', $view);
  10. $this->assertContains("row.cells[5].addEventListener('click'", $view);
  11. $this->assertContains('beginInlineOddsEdit(row, row.cells[5]);', $view);
  12. $this->assertContains('event.preventDefault();', $view);
  13. $this->assertContains("X-Requested-With', 'XMLHttpRequest'", $view);
  14. $this->assertContains('saveInlineOdds(row, input.value);', $view);
  15. $this->assertContains('world-cup-odds-ajax-result', $view);
  16. $this->assertNotContains("form.scrollIntoView({ behavior: 'smooth', block: 'center' });", $view);
  17. }
  18. }