Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next site settings and config ignores #735

Merged
merged 4 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/sync/config_ignore.settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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_*'
Expand Down
5 changes: 4 additions & 1 deletion config/sync/next.settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions config/sync/user.role.decoupled_site_users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ dependencies:
- file
- node
- subrequests
- view_unpublished
id: decoupled_site_users
label: 'Decoupled Site User'
weight: 2
Expand All @@ -15,3 +16,4 @@ permissions:
- 'bypass node access'
- 'delete own files'
- 'issue subrequests'
- 'view any unpublished content'
1 change: 1 addition & 0 deletions tests/codeception/acceptance/Content/PersonCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
56 changes: 45 additions & 11 deletions tests/codeception/acceptance/Paragraphs/ListsCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down Expand Up @@ -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');
Expand All @@ -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');

Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -341,14 +364,15 @@ public function testEmptyResultsListEvents(AcceptanceTester $I) {
],
]);

$I->amOnPage('/');
$I->amOnPage($node->toUrl()->toString());
$I->cantSee($headline_text);
$I->cantSee($message);
}

/**
* Event items should display in the list paragraph.
*
* @group jsonapi
*/
public function testListParagraphEvents(AcceptanceTester $I) {
$I->logInWithRole('contributor');
Expand Down Expand Up @@ -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);
}

/**
Expand Down
Loading