Fix acceptance test
MAILPOET-5949
This commit is contained in:
committed by
Oluwaseun Olorunsola
parent
36130c9809
commit
08ba9b1da9
@ -98,8 +98,8 @@ class EmailTemplatesCest {
|
||||
$i->waitForElementClickable('.email-editor-start_from_scratch_button');
|
||||
$i->click('[aria-label="Basic"]');
|
||||
$i->waitForElement('.block-editor-block-patterns-list__item-title');
|
||||
$i->waitForText($template);
|
||||
$i->click("//div[@class='block-editor-block-patterns-list__item-title' and text()='$template']");
|
||||
$i->waitForText($template, 5);
|
||||
$i->click("//h4[@class='block-editor-block-patterns-list__item-title' and text()='$template']");
|
||||
}
|
||||
|
||||
private function checkTextIsInEmail(\AcceptanceTester $i, string $text): void {
|
||||
|
@ -32,13 +32,15 @@ function SelectTemplateBody( {
|
||||
handleTemplateSelection,
|
||||
} ) {
|
||||
const [ selectedCategory, setSelectedCategory ] = useState(
|
||||
TemplateCategories[ 0 ].name // Show the “Recent” category by default
|
||||
TemplateCategories[ 1 ].name // Show the “Basic” category by default
|
||||
);
|
||||
|
||||
useEffect( () => {
|
||||
if ( ! hasEmailPosts ) {
|
||||
setSelectedCategory( TemplateCategories[ 1 ].name );
|
||||
setTimeout( () => {
|
||||
if ( hasEmailPosts ) {
|
||||
setSelectedCategory( TemplateCategories[ 0 ].name );
|
||||
}
|
||||
}, 1000 ); // using setTimeout to ensure the template styles are available before block preview
|
||||
}, [ hasEmailPosts ] );
|
||||
|
||||
return (
|
||||
|
@ -148,7 +148,7 @@ export const getSentEmailEditorPosts = createRegistrySelector(
|
||||
} )
|
||||
?.filter(
|
||||
( post: EmailEditorPostType ) => post?.content?.raw !== '' // filter out empty content
|
||||
)
|
||||
) || []
|
||||
);
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user