fix(frontend): sprint 5 — correct API path /simulation-templates → /templates
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -51,7 +51,7 @@ describe('TemplatePickerModal', () => {
|
||||
});
|
||||
|
||||
it('shows loading state while fetching', () => {
|
||||
mock.onGet('/simulation-templates').reply(() => new Promise(() => {}));
|
||||
mock.onGet('/templates').reply(() => new Promise(() => {}));
|
||||
renderWithProviders(
|
||||
<TemplatePickerModal
|
||||
engagementId={1}
|
||||
@@ -64,7 +64,7 @@ describe('TemplatePickerModal', () => {
|
||||
});
|
||||
|
||||
it('shows empty state when no templates', async () => {
|
||||
mock.onGet('/simulation-templates').reply(200, []);
|
||||
mock.onGet('/templates').reply(200, []);
|
||||
renderWithProviders(
|
||||
<TemplatePickerModal
|
||||
engagementId={1}
|
||||
@@ -80,7 +80,7 @@ describe('TemplatePickerModal', () => {
|
||||
});
|
||||
|
||||
it('lists templates with name and MITRE count', async () => {
|
||||
mock.onGet('/simulation-templates').reply(200, TEMPLATES);
|
||||
mock.onGet('/templates').reply(200, TEMPLATES);
|
||||
renderWithProviders(
|
||||
<TemplatePickerModal
|
||||
engagementId={1}
|
||||
@@ -99,7 +99,7 @@ describe('TemplatePickerModal', () => {
|
||||
});
|
||||
|
||||
it('calls onSelectTemplate when a template row is clicked', async () => {
|
||||
mock.onGet('/simulation-templates').reply(200, TEMPLATES);
|
||||
mock.onGet('/templates').reply(200, TEMPLATES);
|
||||
const user = userEvent.setup();
|
||||
renderWithProviders(
|
||||
<TemplatePickerModal
|
||||
@@ -117,7 +117,7 @@ describe('TemplatePickerModal', () => {
|
||||
});
|
||||
|
||||
it('calls onClose when Cancel is clicked', async () => {
|
||||
mock.onGet('/simulation-templates').reply(200, TEMPLATES);
|
||||
mock.onGet('/templates').reply(200, TEMPLATES);
|
||||
const user = userEvent.setup();
|
||||
renderWithProviders(
|
||||
<TemplatePickerModal
|
||||
@@ -135,7 +135,7 @@ describe('TemplatePickerModal', () => {
|
||||
});
|
||||
|
||||
it('shows error state on fetch failure', async () => {
|
||||
mock.onGet('/simulation-templates').reply(500, { error: 'Server error' });
|
||||
mock.onGet('/templates').reply(500, { error: 'Server error' });
|
||||
renderWithProviders(
|
||||
<TemplatePickerModal
|
||||
engagementId={1}
|
||||
|
||||
Reference in New Issue
Block a user