-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c862022
commit 9ff2377
Showing
6 changed files
with
148 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<script setup> | ||
import Container from './Container.vue' | ||
import { Modal, visitModal } from 'inertiaui/modal' | ||
</script> | ||
|
||
<template> | ||
<Container> | ||
<div class="flex justify-between"> | ||
<h2 class="text-lg font-medium text-gray-900">Visit programmatically</h2> | ||
|
||
<button @click="visitModal('#local')" type="button"> | ||
Open Local Modal | ||
</button> | ||
|
||
<button @click="visitModal('/data', { method: 'post', data: {message: 'Hi again!'}})" type="button"> | ||
Open Route Modal | ||
</button> | ||
</div> | ||
</Container> | ||
|
||
<Modal name="local"> | ||
Hi there! | ||
</Modal> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace Tests\Browser; | ||
|
||
use PHPUnit\Framework\Attributes\Test; | ||
use Tests\DuskTestCase; | ||
|
||
class VisitTest extends DuskTestCase | ||
{ | ||
#[Test] | ||
public function it_can_programmatically_visit_a_local_modal() | ||
{ | ||
$this->browse(function (Browser $browser) { | ||
|
||
$browser->visit('/visit') | ||
->waitForText('Visit programmatically') | ||
->press('Open Local Modal') | ||
->waitFor('.im-dialog') | ||
->assertSeeIn('.im-modal-content', 'Hi there!'); | ||
}); | ||
} | ||
|
||
#[Test] | ||
public function it_can_programmatically_visit_a_modal() | ||
{ | ||
$this->browse(function (Browser $browser) { | ||
|
||
$browser->visit('/visit') | ||
->waitForText('Visit programmatically') | ||
->press('Open Route Modal') | ||
->waitFor('.im-dialog') | ||
->assertSeeIn('.im-modal-content', 'Hi again!'); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters