diff --git a/e2e/pages.spec.ts b/e2e/pages.spec.ts
index d638cfd..e44a3bf 100644
--- a/e2e/pages.spec.ts
+++ b/e2e/pages.spec.ts
@@ -149,16 +149,11 @@ test('tea gobernanza: every section in sync mode, and the preview saved as PDF',
'Ejecución',
'Modelos',
'Entrenamiento',
- 'Subir archivos',
'Bundles',
'Estudios EEG',
]);
- await expect(page.locator('app-eeg-preview')).toHaveCount(0);
+ await expect(page.getByRole('heading', { name: 'Subir archivos', exact: true })).toHaveCount(0);
await expect(page.getByText('Archivos de entrenamiento', { exact: true })).toHaveCount(0);
- const uploads = page.getByRole('region', { name: 'Subir archivos' });
- await expect(uploads.getByLabel('Conjunto')).toBeVisible();
- await expect(uploads.getByRole('button', { name: 'Archivos', exact: true })).toBeVisible();
- await expect(uploads.getByRole('button', { name: 'Subir archivos' })).toBeDisabled();
await page.getByRole('combobox', { name: 'Modo' }).click();
await page.getByRole('option', { name: 'Sync' }).click();
await expect(page.getByRole('status').filter({ hasText: 'Disponible' })).toBeVisible();
@@ -205,14 +200,28 @@ test('tea gobernanza: every section in sync mode, and the preview saved as PDF',
{ timeout: 10 * 60_000 },
);
- await page
- .locator('app-governance-models')
- .getByRole('button', {
- name: 'Evaluar un solo estudio',
- })
- .click();
- const preview = page.locator('app-eeg-preview');
- await expect(preview.getByRole('heading', { name: 'Vista previa' })).toBeVisible();
+ const models = page.getByRole('region', { name: 'Modelos' });
+ const toggle = models.getByRole('button', { name: 'Evaluar un solo estudio' });
+ const preview = models.locator('.button-row + app-eeg-preview');
+ const edf = preview.getByRole('button', { name: 'EDF', exact: true });
+ const ados = preview.getByRole('button', { name: 'ADOS-2 (PDF)', exact: true });
+ const birth = preview.getByLabel('Fecha de nacimiento');
+ await expect(toggle).toHaveAttribute('aria-pressed', 'false');
+ await expect(edf).toBeHidden();
+ await expect(ados).toBeHidden();
+ await expect(birth).toBeHidden();
+ await toggle.click();
+ await expect(toggle).toHaveAttribute('aria-pressed', 'true');
+ await expect(page.getByRole('heading', { name: 'Vista previa', exact: true })).toHaveCount(0);
+ await expect(edf).toBeVisible();
+ await expect(ados).toBeVisible();
+ await expect(birth).toBeVisible();
+ await toggle.click();
+ await expect(toggle).toHaveAttribute('aria-pressed', 'false');
+ await expect(edf).toBeHidden();
+ await expect(ados).toBeHidden();
+ await expect(birth).toBeHidden();
+ await toggle.click();
await preview.getByLabel('EDF').setInputFiles(process.env['TEA_EDF']!);
await preview.getByLabel('ADOS-2 (PDF)').setInputFiles(process.env['TEA_ADOS2']!);
await preview.getByLabel('Fecha de nacimiento').fill(process.env['TEA_BIRTH']!);
@@ -306,9 +315,5 @@ test('cacu gobernanza: the shared sections only, none of the TEA ones', async ({
const nav = page.getByRole('navigation', { name: 'Dominios' });
await expect(nav.getByRole('link', { name: 'Cáncer de mama' })).toBeVisible();
await expect(nav.getByRole('link', { name: 'Trastorno del espectro autista' })).toBeVisible();
- expect(
- problems.filter(
- (p) => !p.endsWith('/models/cacu/all/inputs') && !p.startsWith('console: Failed to load'),
- ),
- ).toEqual([]);
+ expect(problems.filter((p) => !p.startsWith('console: Failed to load'))).toEqual([]);
});
diff --git a/openapi.json b/openapi.json
index ae92b0c..77b49fc 100644
--- a/openapi.json
+++ b/openapi.json
@@ -255,24 +255,6 @@
"title": "Body_upload",
"type": "object"
},
- "Body_upload_training_inputs": {
- "properties": {
- "files": {
- "items": {
- "format": "binary",
- "type": "string"
- },
- "minItems": 1,
- "title": "Files",
- "type": "array"
- }
- },
- "required": [
- "files"
- ],
- "title": "Body_upload_training_inputs",
- "type": "object"
- },
"Browsed": {
"properties": {
"entries": {
@@ -5121,134 +5103,6 @@
]
}
},
- "/models/{domain}/{name}/inputs": {
- "get": {
- "operationId": "training_inputs",
- "parameters": [
- {
- "in": "path",
- "name": "domain",
- "required": true,
- "schema": {
- "$ref": "#/components/schemas/Domain"
- }
- },
- {
- "in": "path",
- "name": "name",
- "required": true,
- "schema": {
- "title": "Name",
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "content": {
- "application/json": {
- "schema": {
- "additionalProperties": {
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- "title": "Response Training Inputs",
- "type": "object"
- }
- }
- },
- "description": "Successful Response"
- },
- "422": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- },
- "description": "Validation Error"
- }
- },
- "summary": "Training Inputs",
- "tags": [
- "models"
- ]
- }
- },
- "/models/{domain}/{name}/inputs/{set}/files": {
- "post": {
- "operationId": "upload_training_inputs",
- "parameters": [
- {
- "in": "path",
- "name": "domain",
- "required": true,
- "schema": {
- "$ref": "#/components/schemas/Domain"
- }
- },
- {
- "in": "path",
- "name": "name",
- "required": true,
- "schema": {
- "title": "Name",
- "type": "string"
- }
- },
- {
- "in": "path",
- "name": "set",
- "required": true,
- "schema": {
- "title": "Set",
- "type": "string"
- }
- }
- ],
- "requestBody": {
- "content": {
- "multipart/form-data": {
- "schema": {
- "$ref": "#/components/schemas/Body_upload_training_inputs"
- }
- }
- },
- "required": true
- },
- "responses": {
- "200": {
- "content": {
- "application/json": {
- "schema": {
- "additionalProperties": true,
- "title": "Response Upload Training Inputs",
- "type": "object"
- }
- }
- },
- "description": "Successful Response"
- },
- "422": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- },
- "description": "Validation Error"
- }
- },
- "summary": "Upload Training Inputs",
- "tags": [
- "models"
- ]
- }
- },
"/models/{domain}/{name}/training-config": {
"get": {
"operationId": "training_config",
diff --git a/src/app/api/fn/models/training-inputs.ts b/src/app/api/fn/models/training-inputs.ts
deleted file mode 100644
index b27ecf2..0000000
--- a/src/app/api/fn/models/training-inputs.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-/* eslint-disable */
-/* Code generated by ng-openapi-gen DO NOT EDIT. */
-
-import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http';
-import { Observable } from 'rxjs';
-import { filter, map } from 'rxjs/operators';
-import { StrictHttpResponse } from '../../strict-http-response';
-import { RequestBuilder } from '../../request-builder';
-
-import { Domain } from '../../models/domain';
-
-export interface TrainingInputs$Params {
- domain: Domain;
- name: string;
-}
-
-export function trainingInputs(http: HttpClient, rootUrl: string, params: TrainingInputs$Params, context?: HttpContext): ObservableBundles
-