Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions client-v3/e2e/tests/08-show-config-cues.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,59 @@
await expect(page.locator('p.mb-0:has-text("Current Page: 1")')).toBeVisible();
});

// ── Cue Renumber ──────────────────────────────────────────────────────────

test('Renumber Cues button is visible in Cue Configuration tab toolbar', async () => {
await page.click(
'.nav-link:has-text("Cue Configuration"), button[role="tab"]:has-text("Configuration")'
);
await expect(page.locator('button:has-text("Renumber Cues")')).toBeVisible();
});

test('opens Renumber Cues modal at step 1', async () => {
await page.click('button:has-text("Renumber Cues")');
await waitForModal(page, 'Renumber Cues');
// Step 1 shows the CSV dropzone and cue type checkboxes
await expect(page.locator('.modal.show .csv-dropzone')).toBeVisible();
});

test('Next button is disabled until a CSV is uploaded and a cue type is selected', async () => {
await expect(page.locator('.modal.show button:has-text("Next")')).toBeDisabled();
});

test('Next button enables after uploading a CSV and selecting a cue type', async () => {
// Upload a minimal MagicQ-style CSV via the hidden file input
const csv = 'Status ,Cue id ,Comment\n,1.00 ,first\n,2.00 ,second\n';
await page.locator('.modal.show input[type="file"]').setInputFiles({
name: 'test.csv',
mimeType: 'text/csv',
buffer: Buffer.from(csv),
});
await expect(page.locator('.modal.show .csv-dropzone--loaded')).toBeVisible();
// Select the first cue type checkbox
await page.click('.modal.show input[type="checkbox"]:first-of-type');
await expect(page.locator('.modal.show button:has-text("Next")')).toBeEnabled();
});

test('step 2 shows empty state when no cues are placed', async () => {
await page.click('.modal.show button:has-text("Next")');
// No cues have been placed in the script at this point in the serial suite
await expect(
page.locator('.modal.show p.text-muted:has-text("No cues require renumbering")')
).toBeVisible();
});

test('Back button returns to step 1', async () => {
await page.click('.modal.show button:has-text("Back")');
// Step 1 is shown again — dropzone is visible
await expect(page.locator('.modal.show .csv-dropzone')).toBeVisible();
});

test('Cancel closes the Renumber Cues modal', async () => {

Check failure on line 170 in client-v3/e2e/tests/08-show-config-cues.spec.ts

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add at least one assertion to this test case.

See more on https://sonarcloud.io/project/issues?id=dreamteamprod_DigiScript&issues=AZ8k_2v7VoNIKH_aWRH1&open=AZ8k_2v7VoNIKH_aWRH1&pullRequest=1274
await page.click('.modal.show button:has-text("Cancel")');
await waitForModalClosed(page);
});

// ── Cue Counts ────────────────────────────────────────────────────────────

test('switches to Cue Counts sub-tab', async () => {
Expand Down
4 changes: 4 additions & 0 deletions client-v3/src/components/show/config/cues/CueEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<BButtonGroup>
<BButton variant="success" @click="goToPageModal?.show()">Go to Page</BButton>
<BButton variant="success" @click="jumpToCueModal?.show()">Go to Cue</BButton>
<BButton variant="outline-warning" @click="renumberModal?.show()">Renumber Cues</BButton>
</BButtonGroup>
</BCol>
<BCol cols="2" style="text-align: right">
Expand Down Expand Up @@ -67,6 +68,7 @@
</BModal>

<JumpToCueModal ref="jumpToCueModal" @navigate="handleJumpToCue" />
<CueRenumberModal ref="renumberModal" />
</BContainer>
</template>

Expand All @@ -78,6 +80,7 @@ import { useShowStore } from '@/stores/show';
import { useUserStore } from '@/stores/user';
import ScriptLineCueEditor from '@/components/show/config/cues/ScriptLineCueEditor.vue';
import JumpToCueModal from '@/components/show/config/cues/JumpToCueModal.vue';
import CueRenumberModal from '@/components/show/config/cues/CueRenumberModal.vue';

const scriptStore = useScriptStore();
const showStore = useShowStore();
Expand All @@ -89,6 +92,7 @@ const changingPage = ref(false);

const goToPageModal = ref<InstanceType<typeof BModal> | null>(null);
const jumpToCueModal = ref<InstanceType<typeof JumpToCueModal> | null>(null);
const renumberModal = ref<InstanceType<typeof CueRenumberModal> | null>(null);

const pageInputNo = ref(1);

Expand Down
Loading
Loading