-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix dav url on dav settings page (#2685)
- Loading branch information
Showing
9 changed files
with
84 additions
and
11 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
namespace Tests\Browser\Pages; | ||
|
||
use Laravel\Dusk\Browser; | ||
use Illuminate\Foundation\Testing\DatabaseTransactions; | ||
|
||
class SettingsDAV extends Page | ||
{ | ||
use DatabaseTransactions; | ||
|
||
/** | ||
* Get the URL for the page. | ||
* | ||
* @return string | ||
*/ | ||
public function url() | ||
{ | ||
return '/settings/dav'; | ||
} | ||
|
||
/** | ||
* Assert that the browser is on the page. | ||
* | ||
* @param Browser $browser | ||
* @return void | ||
*/ | ||
public function assert(Browser $browser) | ||
{ | ||
$browser->assertPathIs($this->url()); | ||
} | ||
|
||
/** | ||
* Get the element shortcuts for the page. | ||
* | ||
* @return array | ||
*/ | ||
public function elements() | ||
{ | ||
return [ | ||
'dav_url_base' => '#dav_url_base', | ||
]; | ||
} | ||
} |
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,28 @@ | ||
<?php | ||
|
||
namespace Tests\Browser\Settings; | ||
|
||
use Tests\DuskTestCase; | ||
use App\Models\User\User; | ||
use Laravel\Dusk\Browser; | ||
use Tests\Browser\Pages\SettingsDAV; | ||
|
||
class DAVControllerTest extends DuskTestCase | ||
{ | ||
/** | ||
* Test if the dav url is present. | ||
*/ | ||
public function test_it_has_dav_url() | ||
{ | ||
$user = factory(User::class)->create(); | ||
$user->account->populateDefaultFields(); | ||
$user->acceptPolicy(); | ||
|
||
$this->browse(function (Browser $browser) use ($user) { | ||
$browser->loginAs($user) | ||
->visit(new SettingsDAV) | ||
->assertVisible('dav_url_base') | ||
->assertSourceHas(config('app.url').'/dav'); | ||
}); | ||
} | ||
} |