Skip to content
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

Bug 1831131: Fix Cluster Dashboard test #5288

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -20,21 +20,26 @@ describe('Cluster Dashboard', () => {
describe('Details Card', () => {
it('has all fields populated', async () => {
expect(clusterDashboardView.detailsCard.isDisplayed()).toBe(true);
const expectedItems = [
'Cluster API Address',
'Cluster ID',
'Provider',
'OpenShift Version',
'Update Channel',
];
const items = clusterDashboardView.detailsCardList.$$('dt');
const values = clusterDashboardView.detailsCardList.$$('dd');

expect(items.count()).toBe(5);
expect(values.count()).toBe(5);
expect(items.get(0).getText()).toEqual('Cluster API Address');
expect(items.get(1).getText()).toEqual('Cluster ID');
expect(items.get(2).getText()).toEqual('Provider');
expect(items.get(3).getText()).toEqual('OpenShift Version');
expect(items.get(4).getText()).toEqual('Update Channel');
for (let i = 0; i < 5; i++) {
expect(items.count()).toBe(expectedItems.length);
expect(values.count()).toBe(expectedItems.length);
expectedItems.forEach((label: string, i: number) => {
expect(items.get(i).getText()).toBe(label);
const text = values.get(i).getText();
expect(text.length).not.toBe(0);
expect(text).not.toBe('Not available');
}
// `Update Channel` is expected to be `Not available` in CI.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: With this PR, the console suite no longer cares if the channel is set or not, right? So this comment could be "Allow for Update Channel to be Not available in CI", or some such to match the code and stay fresh even if for whatever reason channels start getting set again in CI.

if (label !== 'Update Channel') {
expect(text).not.toBe('Not available');
}
});
});
it('has View settings link', () => {
const link = clusterDashboardView.detailsCard.$('[href="/settings/cluster/"]');
Expand Down