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