@@ -43,3 +43,33 @@ test.describe( 'Upsell', () => {
43
43
await expect ( upgradeAlert ) . toBeVisible ( ) ;
44
44
} ) ;
45
45
} ) ;
46
+
47
+ test . describe ( 'List Page Upsell' , ( ) => {
48
+ test . beforeEach ( async ( { requestUtils, page } ) => {
49
+ await page . goto ( '/wp-admin/edit.php?post_type=feedzy_imports' ) ;
50
+ } ) ;
51
+
52
+ test ( 'Import/Export' , async ( { editor, page } ) => {
53
+ // Locate and click the "Import Job" link
54
+ const importButton = page . getByRole ( 'link' , { name : 'Import Job' , exact : true } ) ;
55
+ await expect ( importButton ) . toBeVisible ( ) ;
56
+ await importButton . click ( ) ;
57
+
58
+ // Wait for the popup to become visible
59
+ const upsellPopup = page . locator ( '#fz_import_export_upsell' ) ;
60
+ await expect ( upsellPopup ) . toBeVisible ( ) ;
61
+
62
+ // Locate and check the "Upgrade to PRO" link inside the popup
63
+ const upgradeToProLink = upsellPopup . locator ( 'a' , { hasText : 'Upgrade to PRO' } ) ;
64
+ await expect ( upgradeToProLink ) . toBeVisible ( ) ;
65
+
66
+ // Get the URL from the "Upgrade to PRO" link
67
+ const upsellLink = new URL ( await upgradeToProLink . getAttribute ( 'href' ) ) ;
68
+
69
+ // Validate the URL parameters
70
+ expect ( upsellLink . host ) . toBe ( 'themeisle.com' ) ;
71
+ expect ( upsellLink . searchParams . get ( 'utm_source' ) ) . toBe ( 'wpadmin' ) ;
72
+ expect ( upsellLink . searchParams . get ( 'utm_medium' ) ) . toBe ( 'edit' ) ;
73
+ expect ( upsellLink . searchParams . get ( 'utm_content' ) ) . toBe ( 'feedzy-rss-feeds' ) ;
74
+ } ) ;
75
+ } ) ;
0 commit comments