-
Notifications
You must be signed in to change notification settings - Fork 2
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
3f82b24
commit 0e47d00
Showing
8 changed files
with
100 additions
and
6 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
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,47 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the UI Storia project. | ||
* | ||
* (c) Loïc Sapone <loic@sapone.fr> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace IQ2i\StoriaBundle\Tests\Controller; | ||
|
||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | ||
|
||
class IframeControllerTest extends WebTestCase | ||
{ | ||
public function testComponent(): void | ||
{ | ||
$client = static::createClient(); | ||
$client->request('GET', '/storia/iframe/components/badge?variant=default'); | ||
|
||
$this->assertResponseIsSuccessful(); | ||
$this->assertSelectorTextContains('title', 'UI Storia'); | ||
$this->assertSelectorTextContains('body > span', 'Default'); | ||
} | ||
|
||
public function testPage(): void | ||
{ | ||
$client = static::createClient(); | ||
$client->request('GET', '/storia/iframe/pages/homepage/homepage?variant=default'); | ||
|
||
$this->assertResponseIsSuccessful(); | ||
$this->assertSelectorTextContains('title', 'My website'); | ||
$this->assertSelectorTextContains('body > p', 'This is the homepage hero'); | ||
} | ||
|
||
public function testUnknownView(): void | ||
{ | ||
$client = static::createClient(); | ||
$client->request('GET', '/storia/iframe/components/unknown?variant=default'); | ||
|
||
$this->assertResponseStatusCodeSame(404); | ||
} | ||
} |
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,39 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the UI Storia project. | ||
* | ||
* (c) Loïc Sapone <loic@sapone.fr> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace IQ2i\StoriaBundle\Tests\Controller; | ||
|
||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | ||
|
||
class ViewControllerTest extends WebTestCase | ||
{ | ||
public function testComponent(): void | ||
{ | ||
$client = static::createClient(); | ||
$crawler = $client->request('GET', '/storia/components/badge?variant=default'); | ||
|
||
$this->assertResponseIsSuccessful(); | ||
$this->assertCount(4, $crawler->filter('header > .tabs > .tabs__item')); | ||
$this->assertCount(3, $crawler->filter('main > div > div > .tabs > .tabs__item')); | ||
} | ||
|
||
public function testUnknownView(): void | ||
{ | ||
$client = static::createClient(); | ||
$crawler = $client->request('GET', '/storia/components/unknown?variant=default'); | ||
|
||
$this->assertResponseIsSuccessful(); | ||
$this->assertSelectorExists('main'); | ||
$this->assertEquals('', $crawler->filter('.main__inner')->innerText()); | ||
} | ||
} |
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