Skip to content

Commit

Permalink
Update events minicalendar functional test
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish committed Jun 10, 2024
1 parent 058f57a commit ad6a08b
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions tests/codeception/functional/Content/EventsCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,25 +66,23 @@ public function testMiniCalendar(FunctionalTester $I) {
]);
$I->amOnPage($node->toUrl()->toString());
$I->canSee('Mini Calendar', 'h2');
$I->canSee(date('F Y'), '.react-calendar');
$I->canSee(date('F Y'), '.mini-calendar');

foreach ($events as $event) {
$start_timestamp = $event->get('su_event_date_time')
->get(0)
->get('value')
->getString();

$start_day = date('j', $start_timestamp);
$button_label = date('M jS Y', $start_timestamp);

// The button element is disabled until the calendar is loaded.
$I->waitForElementChange('//abbr[contains(text(), "' . $start_day . '")]/..', function(WebDriverElement $element) {
return is_null($element->getAttribute('disabled'));
});
$I->click($start_day);
$I->waitForElementClickable("button[aria-label='$button_label']");
$I->wait(1);
$I->click("[aria-label='$button_label']");
$I->waitForText($event->label(), 5);
$I->canSee($event->label(), '.popover-list');
$I->click('Close', '.MuiPaper-root');
$I->click('Next Month');
$I->canSee($event->label(), 'dialog');
$I->click('Close Dialog');
$I->click('Next Month');;
}
}

Expand Down

0 comments on commit ad6a08b

Please sign in to comment.