Skip to content

Commit af52d07

Browse files
committed
Merge branch 'dle-se-ansible-10' into 'master'
Platform (UI): Update tag (v1.0) for dle-se-ansible image, adjust e2e tests See merge request postgres-ai/database-lab!845
2 parents 6940109 + f1246b0 commit af52d07

File tree

3 files changed

+53
-37
lines changed

3 files changed

+53
-37
lines changed

ui/packages/ce/cypress/e2e/tabs.cy.js

Lines changed: 51 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,61 @@
11
/* eslint-disable no-undef */
22

3-
describe('Configuration tab', () => {
4-
before(() => {
5-
// Set the token in local storage
6-
cy.window().then((win) => {
7-
if (!win.localStorage.getItem('token')) {
8-
win.localStorage.setItem('token', 'demo-token')
9-
}
10-
})
3+
Cypress.on('uncaught:exception', () => {
4+
return false
5+
})
6+
7+
// Function to set up intercepts for the requests
8+
function setupIntercepts() {
9+
cy.intercept('GET', '/healthz*', {
10+
statusCode: 200,
11+
body: {
12+
edition: 'standard',
13+
},
1114
})
1215

13-
it('should have token in local storage', () => {
14-
// Check if the token exists in local storage
15-
cy.window()
16-
.should('have.property', 'localStorage')
17-
.and('have.property', 'token', 'demo-token')
16+
cy.intercept('GET', '/instance/retrieval*', {
17+
statusCode: 200,
18+
body: {
19+
status: 'inactive',
20+
},
1821
})
1922

20-
it('should have "Configuration" tab with form inputs', () => {
21-
// Visit the page
22-
cy.visit('/', {
23-
retryOnStatusCodeFailure: true,
24-
onLoad: () => {
25-
// Click on the "Configuration" tab
26-
cy.get('.MuiTabs-flexContainer').contains('Configuration').click({
27-
force: true,
28-
})
29-
30-
// Check for elements on the "Configuration" tab
31-
cy.get('input[type="text"]').should('exist')
32-
cy.get('input[type="checkbox"]').should('exist')
33-
cy.get('button[type="button"]').should('exist')
34-
35-
// Click on the "Cancel" button within the "Configuration" tab
36-
cy.get('button').contains('Cancel').click({
37-
force: true,
38-
})
39-
40-
// Check if the URL has changed to "/instance"
41-
cy.url().should('eq', Cypress.config().baseUrl + '/instance')
23+
cy.intercept('GET', '/status*', {
24+
statusCode: 200,
25+
body: {
26+
status: {
27+
code: 'OK',
28+
message: 'Instance is ready',
29+
},
30+
pools: [],
31+
cloning: {
32+
clones: [],
4233
},
34+
retrieving: {
35+
status: 'inactive',
36+
},
37+
},
38+
})
39+
}
40+
41+
describe('Configuration tab', () => {
42+
beforeEach(() => {
43+
cy.visit('/')
44+
setupIntercepts()
45+
})
46+
47+
it('should have "Configuration" tab with form inputs', () => {
48+
cy.get('.MuiTabs-flexContainer').contains('Configuration').click({
49+
force: true,
50+
})
51+
52+
cy.get('input[type="text"]').should('exist')
53+
cy.get('input[type="checkbox"]').should('exist')
54+
cy.get('button[type="button"]').should('exist')
55+
56+
cy.get('button').contains('Cancel').click({
57+
force: true,
4358
})
59+
cy.url().should('eq', Cypress.config().baseUrl + '/instance')
4460
})
4561
})

ui/packages/platform/src/components/DbLabInstanceForm/utils/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const DEBUG_API_SERVER = 'https://v2.postgres.ai/api/general'
77

88
export const availableTags = ['3.5.0', '3.4.0', '4.0.0-alpha.6']
99

10-
export const sePackageTag = 'v1.0-rc.10'
10+
export const sePackageTag = 'v1.0'
1111

1212
export const dockerRunCommand = (provider: string) => {
1313
/* eslint-disable no-template-curly-in-string */

ui/packages/shared/types/api/entities/instanceState.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export const formatInstanceStateDto = (dto: InstanceStateDto) => {
5858

5959
const pools = dto.pools?.map(formatPoolDto) ?? null
6060
const clones =
61-
dto?.clones?.map(formatCloneDto) ?? dto.cloning?.clones.map(formatCloneDto)
61+
dto?.clones?.map(formatCloneDto) ?? dto.cloning?.clones?.map(formatCloneDto)
6262
const expectedCloningTime =
6363
dto?.expectedCloningTime ?? dto.cloning?.expectedCloningTime
6464

0 commit comments

Comments
 (0)