-
Notifications
You must be signed in to change notification settings - Fork 364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: [UIE-8259] dbaas summary blank read-only host should be N/A #11265
fix: [UIE-8259] dbaas summary blank read-only host should be N/A #11265
Conversation
60e2218
to
b6dd438
Compare
Coverage Report: ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but the test should probably be cleaned up a bit
const database = databaseFactory.build({ | ||
engine: POSTGRESQL, | ||
hosts: { | ||
primary: DEFAULT_PRIMARY, | ||
}, | ||
id: 99, | ||
platform: 'rdbms-default', | ||
port: 22496, | ||
ssl_connection: true, | ||
}) as Database; | ||
// Overwrite hosts so that only primary is available | ||
database.hosts = { primary: DEFAULT_PRIMARY }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this might be a more simple way to express this:
- We don't need
as Database
- Rather than overwriting the
hosts
after the factory has been created, I think we can just do it in the factory
const database = databaseFactory.build({ | |
engine: POSTGRESQL, | |
hosts: { | |
primary: DEFAULT_PRIMARY, | |
}, | |
id: 99, | |
platform: 'rdbms-default', | |
port: 22496, | |
ssl_connection: true, | |
}) as Database; | |
// Overwrite hosts so that only primary is available | |
database.hosts = { primary: DEFAULT_PRIMARY }; | |
const database = databaseFactory.build({ | |
engine: POSTGRESQL, | |
hosts: { | |
primary: DEFAULT_PRIMARY, | |
secondary: undefined, | |
standby: undefined, | |
}, | |
id: 99, | |
platform: 'rdbms-default', | |
port: 22496, | |
ssl_connection: true, | |
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, that is simpler. I've applied this change!
queryMocks.useDatabaseCredentialsQuery.mockReturnValue({ | ||
data: { | ||
password: 'abc123', | ||
username: AKMADMIN, | ||
}, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove this? This unit test has nothing to do with credentials
queryMocks.useDatabaseCredentialsQuery.mockReturnValue({ | |
data: { | |
password: 'abc123', | |
username: AKMADMIN, | |
}, | |
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this and the expect block for it below.
await waitFor(() => { | ||
expect(queryAllByText('N/A')).toHaveLength(1); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the waitFor
? This test doesn't seem to do anything async so it may not be needed
await waitFor(() => { | |
expect(queryAllByText('N/A')).toHaveLength(1); | |
}); | |
expect(queryAllByText('N/A')).toHaveLength(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's not necessary, so I've removed it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
b6dd438
to
2bba2be
Compare
2bba2be
to
d8ff309
Compare
Cloud Manager UI test results🔺 1 failing test on test run #4 ↗︎
Details
TroubleshootingUse this command to re-run the failing tests: yarn cy:run -s "cypress/e2e/core/linodes/clone-linode.spec.ts" |
Description 📝
Fixing DBaaS summary so that when the read-only host field is displayed and backend does not return a read-only host., N/A is displayed
Changes 🔄
When read-only host field has no value (secondary/standby), it displays N/A
Target release date 🗓️
12/10/2024
Preview 📷
How to test 🧪
Prerequisites
Reproduction steps
Verification steps
As an Author, I have considered 🤔
As an Author, before moving this PR from Draft to Open, I confirmed ✅