diff --git a/frontend/src/__tests__/cypress/cypress/tests/mocked/projects/connections.cy.ts b/frontend/src/__tests__/cypress/cypress/tests/mocked/projects/connections.cy.ts index c30e11b09e..2b57e609f7 100644 --- a/frontend/src/__tests__/cypress/cypress/tests/mocked/projects/connections.cy.ts +++ b/frontend/src/__tests__/cypress/cypress/tests/mocked/projects/connections.cy.ts @@ -117,7 +117,23 @@ describe('Connections', () => { cy.findByTestId('connection-name-desc-name').fill('new connection'); cy.findByTestId('modal-submit-button').click(); - cy.wait('@createConnection'); + cy.wait('@createConnection').then((interception) => { + expect(interception.request.body).to.eql({ + apiVersion: 'v1', + kind: 'Secret', + metadata: { + annotations: { + 'opendatahub.io/connection-type': 'test', + 'openshift.io/description': '', + 'openshift.io/display-name': 'new connection', + }, + labels: { 'opendatahub.io/dashboard': 'true', 'opendatahub.io/managed': 'true' }, + name: 'new-connection', + namespace: 'test-project', + }, + stringData: {}, + }); + }); }); it('Edit a connection', () => { @@ -149,6 +165,31 @@ describe('Connections', () => { cy.findByTestId(['field_env']).fill('new data'); cy.findByTestId('modal-submit-button').click(); - cy.wait('@editConnection'); + cy.wait('@editConnection').then((interception) => { + expect(interception.request.body).to.eql({ + apiVersion: 'v1', + kind: 'Secret', + metadata: { + annotations: { + 'opendatahub.io/connection-type': 'postgres', + 'openshift.io/description': '', + 'openshift.io/display-name': 'test2', + }, + labels: { 'opendatahub.io/dashboard': 'true', 'opendatahub.io/managed': 'true' }, + name: 'test2', + namespace: 'test-project', + }, + stringData: { + /* eslint-disable camelcase */ + AWS_ACCESS_KEY_ID: 'sdsd', + AWS_SECRET_ACCESS_KEY: 'sdsd', + AWS_S3_ENDPOINT: 'https://s3.amazonaws.com/', + AWS_DEFAULT_REGION: 'us-east-1', + AWS_S3_BUCKET: 'test-bucket', + field_env: 'new data', + /* eslint-enable camelcase */ + }, + }); + }); }); });