Skip to content

Commit

Permalink
Merge pull request #13135 from richard-cox/fix-fleet-bundles
Browse files Browse the repository at this point in the history
[2.10] Fix gitrepo bundle list and bundle list when there's a gitrepo that does not contain a summary
  • Loading branch information
richard-cox authored Jan 16, 2025
2 parents 7dc5b8c + 82d1bce commit 8a339a5
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 31 deletions.
53 changes: 26 additions & 27 deletions cypress/e2e/tests/pages/fleet/gitrepo.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,41 +146,40 @@ describe('Git Repo', { testIsolation: 'off', tags: ['@fleet', '@adminUser'] }, (
;
});

// skipped due to https://github.com/rancher/rancher/issues/48714
// it('check table headers are available in list and details view', { tags: ['@vai', '@adminUser'] }, function() {
// const workspace = 'fleet-default';
it('check table headers are available in list and details view', { tags: ['@vai', '@adminUser'] }, function() {
const workspace = 'fleet-default';

// // go to fleet gitrepo
// listPage.goTo();
// listPage.waitForPage();
// headerPo.selectWorkspace(workspace);
// go to fleet gitrepo
listPage.goTo();
listPage.waitForPage();
headerPo.selectWorkspace(workspace);

// // check table headers
// const expectedHeadersListView = ['State', 'Name', 'Repo', 'Target', 'Clusters Ready', 'Resources', 'Age'];
// check table headers
const expectedHeadersListView = ['State', 'Name', 'Repo', 'Target', 'Clusters Ready', 'Resources', 'Age'];

// listPage.repoList().resourceTable().sortableTable().tableHeaderRow()
// .within('.table-header-container .content')
// .each((el, i) => {
// expect(el.text().trim()).to.eq(expectedHeadersListView[i]);
// });
listPage.repoList().resourceTable().sortableTable().tableHeaderRow()
.within('.table-header-container .content')
.each((el, i) => {
expect(el.text().trim()).to.eq(expectedHeadersListView[i]);
});

// // go to fleet gitrepo details
// listPage.repoList().details(this.gitRepo, 2).find('a').click();
// go to fleet gitrepo details
listPage.repoList().details(this.gitRepo, 2).find('a').click();

// const gitRepoDetails = new FleetGitRepoDetailsPo(workspace, this.gitRepo);
const gitRepoDetails = new FleetGitRepoDetailsPo(workspace, this.gitRepo);

// gitRepoDetails.waitForPage(null, 'bundles');
gitRepoDetails.waitForPage(null, 'bundles');

// // check table headers
// const expectedHeadersDetailsView = ['State', 'Name', 'Deployments', 'Last Updated', 'Date'];
// check table headers
const expectedHeadersDetailsView = ['State', 'Name', 'Deployments', 'Last Updated', 'Date'];

// gitRepoDetails.bundlesTab().list().resourceTable().sortableTable()
// .tableHeaderRow()
// .within('.table-header-container .content')
// .each((el, i) => {
// expect(el.text().trim()).to.eq(expectedHeadersDetailsView[i]);
// });
// });
gitRepoDetails.bundlesTab().list().resourceTable().sortableTable()
.tableHeaderRow()
.within('.table-header-container .content')
.each((el, i) => {
expect(el.text().trim()).to.eq(expectedHeadersDetailsView[i]);
});
});

it('check all tabs are available in the details view', function() {
// testing https://github.com/rancher/dashboard/issues/11155
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"e2e:dev": "START_SERVER_AND_TEST_INSECURE=1 server-test start:dev https-get://localhost:8005 cy:run:sorry",
"e2e:build": "mkdir dist && TEST_INSTRUMENT=false ./scripts/build-e2e",
"e2e:docker": "yarn docker:local:stop && ./scripts/e2e-docker-start $RANCHER_VERSION_E2E",
"e2e:prod": "BUILD_DASHBOARD=$BUILD_DASHBOARD GREP_TAGS=$GREP_TAGS TEST_USERNAME=$TEST_USERNAME TEST_BASE_URL=https://127.0.0.1/dashboard yarn cy:run:sorry",
"e2e:prod": "BUILD_DASHBOARD=$BUILD_DASHBOARD GREP_TAGS=$GREP_TAGS TEST_USERNAME=$TEST_USERNAME TEST_BASE_URL=https://127.0.0.1/dashboard yarn cy:run",
"coverage": "npx nyc merge coverage coverage/coverage.json",
"storybook": "cd storybook && yarn install && yarn storybook",
"build-storybook": "cd storybook && yarn install --no-lockfile && NODE_OPTIONS=--max_old_space_size=4096 yarn build-storybook --quiet",
Expand Down
3 changes: 2 additions & 1 deletion shell/components/fleet/FleetBundles.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ export default {
class="text-warning"
>
{{ row.status.summary.ready }}/{{ row.status.summary.desiredReady }}</span>
<span v-else-if="row.status">{{ row.status.summary.desiredReady }}</span>
<span v-else-if="row.status && row.status.summary">{{ row.status.summary.desiredReady }}</span>
<span v-else>-</span>
</template>
</ResourceTable>
</div>
Expand Down
4 changes: 2 additions & 2 deletions shell/list/fleet.cattle.io.bundle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,11 @@ export default {
>
<template #cell:deploymentsReady="{row}">
<span
v-if="row.status && (row.status.summary.desiredReady !== row.status.summary.ready)"
v-if="row.status && row.status.summary && (row.status.summary.desiredReady !== row.status.summary.ready)"
class="text-warning"
>
{{ row.status.summary.ready }}/{{ row.status.summary.desiredReady }}</span>
<span v-else-if="row.status">{{ row.status.summary.desiredReady }}</span>
<span v-else-if="row.status && row.status.summary">{{ row.status.summary.desiredReady }}</span>
<span v-else>-</span>
</template>
</ResourceTable>
Expand Down

0 comments on commit 8a339a5

Please sign in to comment.