Skip to content

Commit

Permalink
Connections interception
Browse files Browse the repository at this point in the history
  • Loading branch information
ashley-o0o committed Oct 14, 2024
1 parent 25e1a44 commit 99593b0
Showing 1 changed file with 43 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down Expand Up @@ -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 */
},
});
});
});
});

0 comments on commit 99593b0

Please sign in to comment.