Updated tests to use ssddanbrown/asserthtml package

Closes #3519
This commit is contained in:
Dan Brown
2022-07-23 15:10:18 +01:00
parent cf73e5f2c6
commit 72c8b138e1
48 changed files with 869 additions and 1014 deletions

View File

@ -44,8 +44,11 @@ class FooterLinksTest extends TestCase
['label' => 'Another Link', 'url' => 'https://example.com/link-b'],
]]);
$this->get('/login')->assertElementContains('footer a[href="https://example.com/link-a"]', 'My custom link');
$this->asEditor()->get('/')->assertElementContains('footer a[href="https://example.com/link-b"]', 'Another link');
$resp = $this->get('/login');
$this->withHtml($resp)->assertElementContains('footer a[href="https://example.com/link-a"]', 'My custom link');
$resp = $this->asEditor()->get('/');
$this->withHtml($resp)->assertElementContains('footer a[href="https://example.com/link-b"]', 'Another link');
}
public function test_using_translation_system_for_labels()
@ -56,7 +59,7 @@ class FooterLinksTest extends TestCase
]]);
$resp = $this->get('/login');
$resp->assertElementContains('footer a[href="https://example.com/privacy"]', 'Privacy Policy');
$resp->assertElementContains('footer a[href="https://example.com/terms"]', 'Terms of Service');
$this->withHtml($resp)->assertElementContains('footer a[href="https://example.com/privacy"]', 'Privacy Policy');
$this->withHtml($resp)->assertElementContains('footer a[href="https://example.com/terms"]', 'Terms of Service');
}
}