setupKitPlugin($I);
+ $I->setupKitPluginResources($I);
+
+ // It's tricky to interact with Gutenberg's typography pickers, so we programmatically create the Page
+ // instead to then confirm the settings apply on the output.
+ // We don't need to test the typography picker itself, as it's a Gutenberg supplied component, and our
+ // other End To End tests confirm that the block can be added in Gutenberg etc.
+ $I->havePageInDatabase(
+ [
+ 'post_name' => 'kit-page-broadcasts-block-typography-params',
+ 'post_content' => '',
+ ]
+ );
+
+ // Load the Page on the frontend site.
+ $I->amOnPage('/kit-page-broadcasts-block-typography-params');
+
+ // Wait for frontend web site to load.
+ $I->waitForElementVisible('body.page-template-default');
+
+ // Check that no PHP warnings or notices were output.
+ $I->checkNoWarningsAndNoticesOnScreen($I);
+
+ // Confirm that the block displays correctly with the expected number of Broadcasts.
+ $I->seeBroadcastsOutput(
+ $I,
+ [
+ 'number_posts' => $_ENV['CONVERTKIT_API_BROADCAST_COUNT'],
+ ]
+ );
+
+ // Confirm that our stylesheet loaded.
+ $I->seeInSource('setupKitPlugin($I);
+ $I->setupKitPluginResources($I);
+
+ // It's tricky to interact with Gutenberg's typography pickers, so we programmatically create the Page
+ // instead to then confirm the settings apply on the output.
+ // We don't need to test the typography picker itself, as it's a Gutenberg supplied component, and our
+ // other End To End tests confirm that the block can be added in Gutenberg etc.
+ $I->havePageInDatabase(
+ [
+ 'post_name' => 'kit-page-form-trigger-block-typography-params',
+ 'post_content' => '',
+ ]
+ );
+
+ // Load the Page on the frontend site.
+ $I->amOnPage('/kit-page-form-trigger-block-typography-params');
+
+ // Wait for frontend web site to load.
+ $I->waitForElementVisible('body.page-template-default');
+
+ // Check that no PHP warnings or notices were output.
+ $I->checkNoWarningsAndNoticesOnScreen($I);
+
+ // Confirm that the block displays and has the inline styles applied.
+ $I->seeFormTriggerOutput(
+ $I,
+ formURL: $_ENV['CONVERTKIT_API_FORM_FORMAT_MODAL_URL'],
+ text: 'Subscribe',
+ cssClasses: 'has-large-font-size',
+ styles: 'line-height:2',
+ isBlock: true
+ );
+ }
+
/**
* Test the Form Trigger block displays a message with a link to the Plugin's
* settings screen, when the Plugin has no credentials specified.
diff --git a/tests/EndToEnd/products/PageBlockProductCest.php b/tests/EndToEnd/products/PageBlockProductCest.php
index c7cd9ea80..e723312db 100644
--- a/tests/EndToEnd/products/PageBlockProductCest.php
+++ b/tests/EndToEnd/products/PageBlockProductCest.php
@@ -564,6 +564,50 @@ public function testProductBlockWithMarginAndPaddingParameters(EndToEndTester $I
);
}
+ /**
+ * Test the Product block's typography parameters works.
+ *
+ * @since 2.8.4
+ *
+ * @param EndToEndTester $I Tester.
+ */
+ public function testProductBlockWithTypographyParameters(EndToEndTester $I)
+ {
+ // Setup Plugin and enable debug log.
+ $I->setupKitPlugin($I);
+ $I->setupKitPluginResources($I);
+
+ // It's tricky to interact with Gutenberg's typography pickers, so we programmatically create the Page
+ // instead to then confirm the settings apply on the output.
+ // We don't need to test the typography picker itself, as it's a Gutenberg supplied component, and our
+ // other End To End tests confirm that the block can be added in Gutenberg etc.
+ $I->havePageInDatabase(
+ [
+ 'post_name' => 'kit-page-product-block-typography-params',
+ 'post_content' => '',
+ ]
+ );
+
+ // Load the Page on the frontend site.
+ $I->amOnPage('/kit-page-product-block-typography-params');
+
+ // Wait for frontend web site to load.
+ $I->waitForElementVisible('body.page-template-default');
+
+ // Check that no PHP warnings or notices were output.
+ $I->checkNoWarningsAndNoticesOnScreen($I);
+
+ // Confirm that the block displays and has the inline styles applied.
+ $I->seeProductOutput(
+ $I,
+ productURL: $_ENV['CONVERTKIT_API_PRODUCT_URL'],
+ text: 'Buy my product',
+ cssClasses: 'has-large-font-size',
+ styles: 'line-height:2',
+ isBlock: true
+ );
+ }
+
/**
* Test the Product block displays a message with a link to the Plugin's
* settings screen, when the Plugin has Not connected to Kit.
diff --git a/tests/Support/Helper/KitForms.php b/tests/Support/Helper/KitForms.php
index 59e02f853..a2f6b05c8 100644
--- a/tests/Support/Helper/KitForms.php
+++ b/tests/Support/Helper/KitForms.php
@@ -76,15 +76,16 @@ public function seeFormOutput($I, $formID, $position = false, $element = false,
*
* @since 2.2.0
*
- * @param EndToEndTester $I Tester.
- * @param string $formURL Form URL.
- * @param bool|string $text Test if the button text matches the given value.
- * @param bool|string $textColor Test if the given text color is applied.
+ * @param EndToEndTester $I Tester.
+ * @param string $formURL Form URL.
+ * @param bool|string $text Test if the button text matches the given value.
+ * @param bool|string $textColor Test if the given text color is applied.
* @param bool|string $backgroundColor Test is the given background color is applied.
- * @param bool|string $styles Test if the given styles are applied.
- * @param bool $isBlock Test if this is a form trigger block or shortcode.
+ * @param bool|string $cssClasses Test if the given CSS classes are applied.
+ * @param bool|string $styles Test if the given styles are applied.
+ * @param bool $isBlock Test if this is a form trigger block or shortcode.
*/
- public function seeFormTriggerOutput($I, $formURL, $text = false, $textColor = false, $backgroundColor = false, $styles = false, $isBlock = false)
+ public function seeFormTriggerOutput($I, $formURL, $text = false, $textColor = false, $backgroundColor = false, $cssClasses = false, $styles = false, $isBlock = false)
{
// Confirm that the button stylesheet loaded.
$I->seeInSource('