Skip to content

Commit

Permalink
Updated tests to reflect new permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
imonroe committed Sep 12, 2023
1 parent 9f4b6a9 commit 54089fb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/codeception/acceptance/Content/EventsSeriesCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ public function testContentTypeExists(AcceptanceTester $I) {
public function testContributorPerms(AcceptanceTester $I) {
$I->logInWithRole('contributor');

// Can create a node.
// D8CORE-4551: Can NOT create a node.
$I->amOnPage('/node/add/stanford_event_series');
$I->canSeeResponseCodeIs(200);
$I->canSeeResponseCodeIs(403);

// Can not delete a node that is not theirs but can edit.
$node = $this->createEventSeriesNode($I);
Expand Down
12 changes: 10 additions & 2 deletions tests/codeception/acceptance/Content/PolicyCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ public function testPolicyAccess(AcceptanceTester $I) {
$I->logInWithRole('contributor');
$I->amOnPage('/node/add/stanford_policy');
$I->cantSee('Create a new book');
// D8CORE-4551 - removed create policy permission for contributors
$I->canSee('Access Denied');
$book = $I->createEntity([
'type' => 'stanford_policy',
'su_policy_title' => $this->faker->words(2, TRUE) . '-baz-foo',
'su_policy_auto_prefix' => 1,
]);
$I->amOnPage($book->toUrl('edit-form')->toString());
// This indicates they can add to an existing book.
$I->canSeeOptionIsSelected('Book', '- None -');
$I->cantSee('Policy Prefix');
Expand All @@ -63,7 +71,7 @@ public function testPolicyAccess(AcceptanceTester $I) {
/**
* Test book title changes.
*/
public function testPolicyTitle(AcceptanceTester $I){
public function testPolicyTitle(AcceptanceTester $I) {
$title = $this->faker->words(4, TRUE) . ' foo bar';
$I->logInWithRole('administrator');
$I->amOnPage('/node/add/stanford_policy');
Expand Down Expand Up @@ -231,7 +239,7 @@ public function testPolicyHeirarcy(AcceptanceTester $I) {
$I->canSee($chapter_two->label(), '.breadcrumb');
$I->canSee($article_one->label(), '.breadcrumb');

$I->canSee( $data_formatter->format($fifteen_days_ago, 'custom', 'F d, Y', self::getTimezone()));
$I->canSee($data_formatter->format($fifteen_days_ago, 'custom', 'F d, Y', self::getTimezone()));
$I->canSee($data_formatter->format($time, 'custom', 'F d, Y', self::getTimezone()));
$I->canSee($authority);

Expand Down

0 comments on commit 54089fb

Please sign in to comment.