From 064abe98a1b7d3ca1b287227b0848f279e1fb7b1 Mon Sep 17 00:00:00 2001 From: Ashley McEntee <123661468+ashley-o0o@users.noreply.github.com> Date: Tue, 15 Oct 2024 16:18:24 -0400 Subject: [PATCH] Connections interception (#3329) --- .../tests/mocked/projects/connections.cy.ts | 45 ++++++++++++++++++- 1 file changed, 43 insertions(+), 2 deletions(-) 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 */ + }, + }); + }); }); });