Commit a52b0303 authored by Liam Morland's avatar Liam Morland
Browse files

ISTWCMS-4086: Test uw_ct_sidebar

parent 9519e337
......@@ -177,6 +177,7 @@ class UwWcmsBasicTest extends BrowserTestBase {
'edit-field-uw-event-date-0-end-value-date' => 'date',
'edit-field-uw-event-date-0-end-value-time' => 'time',
],
// uw_ct_sidebar is tested separately below.
];
foreach ($content_types as $content_type => $extra_fields) {
......@@ -204,6 +205,18 @@ class UwWcmsBasicTest extends BrowserTestBase {
// Check node title.
$this->assertSession()->pageTextContains('Edit layout for ' . $edit['edit-title-0-value']);
}
// Test uw_ct_sidebar. There is no title in the content type, only a node
// reference field.
$edit = [
// The actual title is ignored, but has to be present. The number in
// brackets is used as the nid of the page to attach this sidebar to.
'edit-field-uw-attach-page-0-target-id' => 'Title (1)',
];
$this->drupalPostForm('node/add/uw_ct_sidebar', $edit, 'Save');
// Verify that the user is redirected to the layout edit page.
$this->assertSession()->addressMatches(',^/node/\d+/layout,');
$this->assertSession()->pageTextContains('You are editing the layout for this Sidebar content item.');
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment