Skip to content

Commit

Permalink
Add maximize test
Browse files Browse the repository at this point in the history
  • Loading branch information
GilbertCherrie committed Jul 14, 2023
1 parent a95479e commit 9324990
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions cypress/e2e/ui/Overview/dashboard.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ describe('Overview > Dashboard Tests', () => {
});
});

it('Can minimize a widget', () => {
it('Can minimize / maximize a widget', () => {
cy.get('.card-pf').then((cards) => {
const nums = [...Array(cards.length).keys()];
nums.forEach((index) => {
Expand All @@ -101,6 +101,22 @@ describe('Overview > Dashboard Tests', () => {
}
});
});
cy.get('.card-pf').then((cards) => {
const nums = [...Array(cards.length).keys()];
nums.forEach((index) => {
if (cards[index].firstChild.innerText === newCard) {
cy.get(cards[index]).then((card) => {
cy.get(card.children()[0].children[0].children[0]).click().then(() => {
cy.get('.bx--overflow-menu-options').then((menuItems) => {
cy.get(menuItems.children()[1]).click().then(() => {
expect(card.children()[1].style.display).to.equal('block');
});
});
});
});
}
});
});
});

it('Can zoom a widget', () => {
Expand Down Expand Up @@ -141,7 +157,7 @@ describe('Overview > Dashboard Tests', () => {
cy.wait(5000);
cy.get('@get').then((getCall) => {
expect(getCall.state).to.equal('Complete');
expect(getCall.response).to.include({statusCode: 304});
expect([200, 304]).to.include(getCall.response.statusCode);
});
});
});
Expand Down

0 comments on commit 9324990

Please sign in to comment.