Skip to content

Open-source event management and ticket selling platform — perfect for concerts, conferences, and everything in between 🎟️ If you find this project helpful, please consider giving us a star ⭐️

1.3 KB
Raw Blame
import { test, expect } from '../../fixtures';
import { ProductEditPage } from '../../pages/product-edit.page';
import { createDraftEventWithTicket } from '../../api/factory';
import { uniqueName } from '../../utils/unique';

test.describe('editing a ticket', () => {
  test('an organizer renames a ticket and sees the new name in the list', { tag: '@smoke' }, async ({ authedPage, api, account }) => {
    const event = await createDraftEventWithTicket(api, account.organizerId, { productTitle: 'General Admission' });
    const newName = uniqueName('VIP Ticket');

    const products = new ProductEditPage(authedPage);
    await products.goto(event.eventId);
    await products.renameFirstProduct('General Admission', newName);

    await expect(authedPage.getByRole('heading', { name: newName })).toBeVisible();
    await expect(authedPage.getByRole('heading', { name: 'General Admission' })).toBeHidden();
  });

  test('an organizer opens a ticket for editing by clicking its row', async ({ authedPage, api, account }) => {
    const event = await createDraftEventWithTicket(api, account.organizerId, { productTitle: 'Early Bird' });

    const products = new ProductEditPage(authedPage);
    await products.goto(event.eventId);
    await products.openProductByTitle('Early Bird');

    await expect(authedPage.getByLabel(/^Name/)).toHaveValue('Early Bird');
  });
});