test: standardize naming conventions to snake_case
- Rename demo_event_id → testing_event_id (more explicit) - Rename demo_account_id → testing_account_id (matches convention) - Rename demo_badge_id → event_badge_id (descriptive) - Rename demo_template_id → event_badge_template_id (explicit) - Update all test files for consistency (15 files) - Enhance README with organized test data sections - Update person IDs to match README test data - No regression: 15 tests passing, 7 pre-existing failures unchanged
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
import { ae_app_local_data_defaults } from './_helpers/ae_defaults';
|
||||
import { demo_event_id, demo_account_id } from './_helpers/env';
|
||||
import { testing_event_id, testing_account_id } from './_helpers/env';
|
||||
|
||||
const demo_event = demo_event_id;
|
||||
const event_id = testing_event_id;
|
||||
|
||||
test.describe('Event Badge - interaction', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
@@ -18,13 +18,13 @@ test.describe('Event Badge - interaction', () => {
|
||||
const url = req.url();
|
||||
|
||||
// Provide the minimal event payload for the settings page to render
|
||||
if (url.includes(`/v3/crud/event/${demo_event}`) && req.method() === 'GET') {
|
||||
if (url.includes(`/v3/crud/event/${event_id}`) && req.method() === 'GET') {
|
||||
return route.fulfill({
|
||||
status: 200,
|
||||
contentType: 'application/json',
|
||||
body: JSON.stringify({ data: {
|
||||
id: demo_event,
|
||||
event_id: demo_event,
|
||||
id: event_id,
|
||||
event_id: event_id,
|
||||
name: 'Test Event for Badge Interaction',
|
||||
cfg_json: {},
|
||||
mod_pres_mgmt_json: {},
|
||||
@@ -37,7 +37,7 @@ test.describe('Event Badge - interaction', () => {
|
||||
}
|
||||
|
||||
// For badge create requests, return a simple created envelope with a fixed id.
|
||||
if (url.includes(`/v3/crud/event/${demo_event}/event_badge`) && req.method() === 'POST') {
|
||||
if (url.includes(`/v3/crud/event/${event_id}/event_badge`) && req.method() === 'POST') {
|
||||
return route.fulfill({ status: 201, contentType: 'application/json', body: JSON.stringify({ data: { event_badge_id: 'new-badge-1' } }) });
|
||||
}
|
||||
|
||||
@@ -61,12 +61,12 @@ test.describe('Event Badge - interaction', () => {
|
||||
};
|
||||
window.localStorage.setItem('ae_loc', JSON.stringify(testData));
|
||||
},
|
||||
{ defaults: ae_app_local_data_defaults, event_id: demo_event, account_id: demo_account_id }
|
||||
{ defaults: ae_app_local_data_defaults, event_id: event_id, account_id: testing_account_id }
|
||||
);
|
||||
});
|
||||
|
||||
test('creates a badge via UI and posts to nested endpoint', async ({ page }) => {
|
||||
await page.goto(`/events/${demo_event}/settings`);
|
||||
await page.goto(`/events/${event_id}/settings`);
|
||||
|
||||
const add_btn = page.getByRole('button', { name: 'Add New Badge' });
|
||||
await expect(add_btn).toBeVisible();
|
||||
@@ -89,7 +89,7 @@ test.describe('Event Badge - interaction', () => {
|
||||
await allow_tracking_checkbox.check();
|
||||
|
||||
const [create_request] = await Promise.all([
|
||||
page.waitForRequest((r) => r.url().includes(`/v3/crud/event/${demo_event}/event_badge`) && r.method() === 'POST'),
|
||||
page.waitForRequest((r) => r.url().includes(`/v3/crud/event/${event_id}/event_badge`) && r.method() === 'POST'),
|
||||
page.getByRole('button', { name: 'Create Badge' }).click()
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user