diff --git a/config/sync/config_ignore.settings.yml b/config/sync/config_ignore.settings.yml index 1289aaf0e..4b1d3469b 100644 --- a/config/sync/config_ignore.settings.yml +++ b/config/sync/config_ignore.settings.yml @@ -5,6 +5,7 @@ ignored_config_entities: - 'block.block.*' - 'core.extension:theme' - 'google_tag.container.*' + - 'next.next_entity_type_config.*' - 'next.next_site.*' - 'samlauth.authentication:map_users_roles' - 'system.action.user_add_role_action.custm_*' diff --git a/config/sync/next.settings.yml b/config/sync/next.settings.yml index 19893cfd6..5a38867e1 100644 --- a/config/sync/next.settings.yml +++ b/config/sync/next.settings.yml @@ -4,5 +4,8 @@ langcode: en site_previewer: iframe site_previewer_configuration: width: 100% - sync_route: false + sync_route: true sync_route_skip_routes: '' +preview_url_generator: simple_preview +preview_url_generator_configuration: null +debug: false diff --git a/config/sync/user.role.decoupled_site_users.yml b/config/sync/user.role.decoupled_site_users.yml index 35faf8782..93a7dec50 100644 --- a/config/sync/user.role.decoupled_site_users.yml +++ b/config/sync/user.role.decoupled_site_users.yml @@ -6,6 +6,7 @@ dependencies: - file - node - subrequests + - view_unpublished id: decoupled_site_users label: 'Decoupled Site User' weight: 2 @@ -15,3 +16,4 @@ permissions: - 'bypass node access' - 'delete own files' - 'issue subrequests' + - 'view any unpublished content' diff --git a/tests/codeception/acceptance/Content/PersonCest.php b/tests/codeception/acceptance/Content/PersonCest.php index b0241db93..4f6c3f7bf 100644 --- a/tests/codeception/acceptance/Content/PersonCest.php +++ b/tests/codeception/acceptance/Content/PersonCest.php @@ -165,6 +165,7 @@ public function testD8Core2613Terms(AcceptanceTester $I) { 'parent' => ['target_id' => $term1->id()], ], 'taxonomy_term'); + $I->runDrush('cache:rebuild'); $I->amOnPage($term3->toUrl()->toString()); $I->canSeeLink($term1->label()); $I->canSeeLink($term2->label()); diff --git a/tests/codeception/acceptance/Paragraphs/ListsCest.php b/tests/codeception/acceptance/Paragraphs/ListsCest.php index 37de1721b..ea55564c8 100644 --- a/tests/codeception/acceptance/Paragraphs/ListsCest.php +++ b/tests/codeception/acceptance/Paragraphs/ListsCest.php @@ -26,6 +26,8 @@ public function __construct() { /** * Shared tags on each content type are identical. + * + * @group jsonapi */ public function testSharedTags(AcceptanceTester $I) { $shared_tag = $I->createEntity([ @@ -112,10 +114,26 @@ public function testSharedTags(AcceptanceTester $I) { $I->canSeeOptionIsSelected('Shared Tags (value 1)', $shared_tag->label()); $I->amOnPage($publication->toUrl('edit-form')->toString()); $I->canSeeOptionIsSelected('Shared Tags (value 1)', $shared_tag->label()); + + $I->amOnPage('/jsonapi/views/stanford_shared_tags/card_grid?page[limit]=50&views-argument[]=' . preg_replace('/[^a-z0-9-]/', '-', strtolower($shared_tag->label()))); + $json_data = json_decode($I->grabPageSource(), TRUE, 512, JSON_THROW_ON_ERROR); + $I->assertArrayHasKey('data', $json_data); + + $json_ids = []; + foreach ($json_data['data'] as $item) { + $json_ids[] = $item['id']; + } + $I->assertContains($basic_page->uuid(), $json_ids); + $I->assertContains($news->uuid(), $json_ids); + $I->assertContains($event->uuid(), $json_ids); + $I->assertContains($person->uuid(), $json_ids); + $I->assertContains($publication->uuid(), $json_ids); } /** * News items should display in the list paragraph. + * + * @group jsonapi */ public function testListParagraphNews(AcceptanceTester $I) { $I->logInWithRole('contributor'); @@ -135,13 +153,25 @@ public function testListParagraphNews(AcceptanceTester $I) { $I->canSee('Lorem Ipsum'); $I->canSeeLink('Google', 'http://google.com'); $I->canSee($title); + + $I->amOnPage('/jsonapi/views/stanford_news/block_1?page[limit]=99'); + $json_data = json_decode($I->grabPageSource(), TRUE, 512, JSON_THROW_ON_ERROR); + $I->assertArrayHasKey('data', $json_data); + + $json_titles = []; + foreach ($json_data['data'] as $item) { + $json_titles[] = $item['attributes']['title']; + } + $I->assertContains($title, $json_titles); } /** * When using the list paragraph and view arguments, it should filter results. + * + * @group jsonapi */ public function testListParagraphNewsFiltersNoFilter(AcceptanceTester $I) { - $I->logInWithRole('site_manager'); + $I->logInWithRole('contributor'); $topic_term = $this->createTaxonomyTerm($I, 'stanford_news_topics'); @@ -169,7 +199,7 @@ public function testListParagraphNewsFiltersNoFilter(AcceptanceTester $I) { * When using the list paragraph and view arguments, it should filter results. */ public function testListParagraphNewsFiltersRandomFilter(AcceptanceTester $I) { - $I->logInWithRole('site_manager'); + $I->logInWithRole('contributor'); $random_term = $this->createTaxonomyTerm($I, 'stanford_news_topics'); $topic_term = $this->createTaxonomyTerm($I, 'stanford_news_topics'); @@ -199,7 +229,7 @@ public function testListParagraphNewsFiltersRandomFilter(AcceptanceTester $I) { * When using the list paragraph and view arguments, it should filter results. */ public function testListParagraphNewsFiltersTopicFilter(AcceptanceTester $I) { - $I->logInWithRole('site_manager'); + $I->logInWithRole('contributor'); $topic_term = $this->createTaxonomyTerm($I, 'stanford_news_topics'); // Use a child term but the argument is the parent term to verify children @@ -257,13 +287,6 @@ public function testEmptyResultsListEvents(AcceptanceTester $I) { ], 'su_list_button' => ['uri' => 'http://google.com', 'title' => 'Google'], ], 'paragraph'); - // $row = $I->createEntity([ - // 'type' => 'node_stanford_page_row', - // 'su_page_components' => [ - // 'target_id' => $paragraph->id(), - // 'entity' => $paragraph, - // ], - // ], 'paragraph_row'); $node = $I->createEntity([ 'type' => 'stanford_page', @@ -341,7 +364,6 @@ public function testEmptyResultsListEvents(AcceptanceTester $I) { ], ]); - $I->amOnPage('/'); $I->amOnPage($node->toUrl()->toString()); $I->cantSee($headline_text); $I->cantSee($message); @@ -349,6 +371,8 @@ public function testEmptyResultsListEvents(AcceptanceTester $I) { /** * Event items should display in the list paragraph. + * + * @group jsonapi */ public function testListParagraphEvents(AcceptanceTester $I) { $I->logInWithRole('contributor'); @@ -459,6 +483,16 @@ public function testListParagraphEvents(AcceptanceTester $I) { ]); $I->amOnPage($node->toUrl()->toString()); $I->cantSee($event->label()); + + $I->amOnPage('/jsonapi/views/stanford_events/list_page?page[limit]=99'); + $json_data = json_decode($I->grabPageSource(), TRUE, 512, JSON_THROW_ON_ERROR); + $I->assertArrayHasKey('data', $json_data); + + $json_titles = []; + foreach ($json_data['data'] as $item) { + $json_titles[] = $item['attributes']['title']; + } + $I->assertContains($event->label(), $json_titles); } /**