upskill-event-manager/wordpress-dev/tests/e2e/test-manage-event-page.test.ts
bengizmo 797ec10771 fix: Fix manage-event page shortcode rendering
- Move HVAC_Manage_Event initialization to proper init() method
- Fix help system initialization (use singleton pattern)
- Add help system to includes list
- Page now properly processes [tribe_community_events] shortcode
- Shows helpful error when TEC Community Events is inactive
2025-05-30 10:59:33 -06:00

41 lines
No EOL
1.7 KiB
TypeScript

import { test, expect } from './fixtures/auth';
import { CommonActions } from './utils/common-actions';
test.describe('Manage Event Page', () => {
test('Shortcode is rendered on manage-event page', async ({ authenticatedPage: page }) => {
test.setTimeout(30000);
const actions = new CommonActions(page);
// Navigate directly to manage-event page
await actions.navigateAndWait('/manage-event/');
// Take a screenshot to see what's rendered
await actions.screenshot('manage-event-page');
// Check that the shortcode is not visible as raw text
const pageContent = await page.locator('body').textContent();
console.log('Page content:', pageContent?.substring(0, 500));
// The raw shortcode should NOT be visible
expect(pageContent).not.toContain('[tribe_community_events');
// Check for either the form or error message
const hasForm = await page.locator('#tribe-community-events').count() > 0;
const hasErrorMessage = await page.locator('.hvac-notice.hvac-error').count() > 0;
if (hasForm) {
console.log('✓ Event submission form is rendered');
expect(hasForm).toBeTruthy();
} else if (hasErrorMessage) {
console.log('✓ Error message is displayed (TEC plugin may be inactive)');
const errorText = await page.locator('.hvac-notice.hvac-error').textContent();
console.log('Error message:', errorText);
expect(hasErrorMessage).toBeTruthy();
} else {
console.log('✗ Neither form nor error message found');
// Log what we actually see
const mainContent = await page.locator('.entry-content, .site-main, main').first().innerHTML();
console.log('Main content HTML:', mainContent);
}
});
});