mirror of
https://github.com/wallabag/wallabag.git
synced 2024-12-27 01:50:29 +00:00
Added test
This commit is contained in:
parent
19322142c3
commit
7eddea6ff7
2 changed files with 37 additions and 1 deletions
|
@ -120,7 +120,7 @@ class Config
|
|||
/**
|
||||
* @var int
|
||||
*
|
||||
* @ORM\Column(name="display_thumbnails", type="integer", nullable=true)
|
||||
* @ORM\Column(name="display_thumbnails", type="integer", nullable=true, options={"default" = 1})
|
||||
*
|
||||
* @Groups({"config_api"})
|
||||
*/
|
||||
|
|
|
@ -1354,4 +1354,40 @@ class ConfigControllerTest extends WallabagCoreTestCase
|
|||
$this->assertCount(5, $taggingRules);
|
||||
$this->assertSame('title matches "football"', $taggingRules[4]->getRule());
|
||||
}
|
||||
|
||||
public function testSwitchDisplayThumbnails()
|
||||
{
|
||||
$this->logInAs('admin');
|
||||
$client = $this->getTestClient();
|
||||
|
||||
// Change configuration to show thumbnails
|
||||
$crawler = $client->request('GET', '/config');
|
||||
$this->assertSame(200, $client->getResponse()->getStatusCode());
|
||||
$form = $crawler->filter('button[id=config_save]')->form();
|
||||
$data = [
|
||||
'config[display_thumbnails]' => true,
|
||||
];
|
||||
$client->submit($form, $data);
|
||||
$client->followRedirect();
|
||||
|
||||
$client->request('GET', '/unread/list');
|
||||
|
||||
$this->assertStringContainsString('class="preview"', $client->getResponse()->getContent());
|
||||
|
||||
// Change configuration to hide thumbnails
|
||||
$crawler = $client->request('GET', '/config');
|
||||
$this->assertSame(200, $client->getResponse()->getStatusCode());
|
||||
$form = $crawler->filter('button[id=config_save]')->form();
|
||||
$data = [
|
||||
'config[display_thumbnails]' => false,
|
||||
];
|
||||
$client->submit($form, $data);
|
||||
$client->followRedirect();
|
||||
|
||||
$client->request('GET', '/unread/list');
|
||||
|
||||
$this->assertStringNotContainsString('class="preview"', $client->getResponse()->getContent());
|
||||
|
||||
$client->request('GET', '/config/view-mode');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue