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:
Scott Idem
2026-02-26 15:43:31 -05:00
parent 2c289e39de
commit a91c648c61
14 changed files with 176 additions and 156 deletions

View File

@@ -1,10 +1,10 @@
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 demo_badge_id = 'test-badge-123';
const demo_template_id = 'jgfixEpYp1B';
const event_id = testing_event_id;
const event_badge_id = 'UIJT-73-63-61'; // Per README test data
const event_badge_template_id = 'jgfixEpYp1B'; // Per README test data
test.describe('Badge Data Integrity & Field Mapping', () => {
test.beforeEach(async ({ page }) => {
@@ -29,7 +29,7 @@ test.describe('Badge Data Integrity & Field Mapping', () => {
};
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 }
);
// Mock V3 API with realistic enriched responses
@@ -46,14 +46,14 @@ test.describe('Badge Data Integrity & Field Mapping', () => {
});
}
if (url.includes(`/v3/crud/event/${demo_event}`) && method === 'GET') {
if (url.includes(`/v3/crud/event/${event_id}`) && method === 'GET') {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({
data: {
id: demo_event,
event_id: demo_event,
id: event_id, // Why are both the id and event_id fields being set?
event_id: event_id, // Why are both the id and event_id fields being set?
name: 'Badge Integrity Test Event',
cfg_json: {},
mod_pres_mgmt_json: {},
@@ -67,17 +67,17 @@ test.describe('Badge Data Integrity & Field Mapping', () => {
}
// Badge search with enriched fields
if (url.includes(`/v3/crud/event/${demo_event}/event_badge/search`) && method === 'POST') {
if (url.includes(`/v3/crud/event/${event_id}/event_badge/search`) && method === 'POST') {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({
data: [
{
id: demo_badge_id,
event_badge_id: demo_badge_id,
event_id: demo_event,
event_badge_template_id: demo_template_id,
id: event_badge_id,
event_badge_id: event_badge_id,
event_id: event_id,
event_badge_template_id: event_badge_template_id,
full_name_override: 'Jane Smith',
given_name: 'Jane',
family_name: 'Smith',
@@ -105,16 +105,16 @@ test.describe('Badge Data Integrity & Field Mapping', () => {
}
// Badge template list
if (url.includes(`/v3/crud/event/${demo_event}/event_badge_template`) && method === 'GET') {
if (url.includes(`/v3/crud/event/${event_id}/event_badge_template`) && method === 'GET') {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({
data: [
{
id: demo_template_id,
event_badge_template_id: demo_template_id,
event_id: demo_event,
id: event_badge_template_id,
event_badge_template_id: event_badge_template_id,
event_id: event_id,
name: 'Standard Template 2026',
header_path: '/images/header.png',
logo_path: '/images/logo.png',
@@ -136,15 +136,15 @@ test.describe('Badge Data Integrity & Field Mapping', () => {
}
// Badge template GET by ID
if (url.includes(`/v3/crud/event_badge_template/${demo_template_id}`) && method === 'GET') {
if (url.includes(`/v3/crud/event_badge_template/${event_badge_template_id}`) && method === 'GET') {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({
data: {
id: demo_template_id,
event_badge_template_id: demo_template_id,
event_id: demo_event,
id: event_badge_template_id,
event_badge_template_id: event_badge_template_id,
event_id: event_id,
name: 'Standard Template 2026',
header_path: '/images/header.png',
logo_path: '/images/logo.png',
@@ -171,7 +171,7 @@ test.describe('Badge Data Integrity & Field Mapping', () => {
});
test('Badge list loads without crashing', async ({ page }) => {
await page.goto(`/events/${demo_event}/badges`);
await page.goto(`/events/${event_id}/badges`);
await page.waitForResponse((r) =>
r.url().includes('event_badge/search') && r.status() === 200
@@ -191,7 +191,7 @@ test.describe('Badge Data Integrity & Field Mapping', () => {
});
test('Badge template list loads and displays all templates', async ({ page }) => {
await page.goto(`/events/${demo_event}/templates`);
await page.goto(`/events/${event_id}/templates`);
await page.waitForResponse((r) =>
r.url().includes('event_badge_template') && r.status() === 200
@@ -209,7 +209,7 @@ test.describe('Badge Data Integrity & Field Mapping', () => {
});
test('Badge template form fields render correctly', async ({ page }) => {
await page.goto(`/events/${demo_event}/templates`);
await page.goto(`/events/${event_id}/templates`);
// Click "Add New Template" button
const add_btn = page.getByRole('button', { name: /Add New Template/i });
@@ -224,7 +224,7 @@ test.describe('Badge Data Integrity & Field Mapping', () => {
});
test('Badge template values persist in form when editing', async ({ page }) => {
await page.goto(`/events/${demo_event}/templates`);
await page.goto(`/events/${event_id}/templates`);
await page.waitForResponse((r) =>
r.url().includes('event_badge_template') && r.status() === 200
@@ -255,7 +255,7 @@ test.describe('Badge Data Integrity & Field Mapping', () => {
(window as any).aetherNative = undefined;
});
await page.goto(`/events/${demo_event}/badges`);
await page.goto(`/events/${event_id}/badges`);
await page.waitForResponse((r) =>
r.url().includes('event_badge/search') && r.status() === 200,
@@ -283,9 +283,9 @@ test.describe('Badge Data Integrity & Field Mapping', () => {
body: JSON.stringify({
data: [
{
id: demo_badge_id,
event_badge_id: demo_badge_id,
event_id: demo_event,
id: event_badge_id,
event_badge_id: event_badge_id,
event_id: event_id,
full_name_override: 'Minimal Badge',
enable: true,
priority: 0,
@@ -299,7 +299,7 @@ test.describe('Badge Data Integrity & Field Mapping', () => {
});
});
await page.goto(`/events/${demo_event}/badges`);
await page.goto(`/events/${event_id}/badges`);
await page.waitForResponse((r) =>
r.url().includes('event_badge/search') && r.status() === 200,