Skip to content

Commit

Permalink
Merge branch 'main' into env-var-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveDarsa committed Jun 30, 2024
2 parents 781370f + 8588f5d commit bf8ff50
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .storybook/mocks/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ export const organizationNotifications = () => {
};

Object.keys(notifications).forEach((key, idx) => {
notifications[key] = generateNotifications(key, idx - 1);
notifications[key as keyof Notifications] = generateNotifications(key, idx - 1) as any;
});

return notifications;
Expand Down
5 changes: 5 additions & 0 deletions cypress/e2e/organizations/notifications.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,15 @@ describe('Org Notifications page', () => {
slack: { name: slackName },
} = testData.organizations.notifications;

cy.waitForNetworkIdle('@idle', 500);
notifications.doDeleteNotification(webhooknName);
cy.waitForNetworkIdle('@idle', 500);
notifications.doDeleteNotification(emailName);
cy.waitForNetworkIdle('@idle', 500);
notifications.doDeleteNotification(teamsName);
cy.waitForNetworkIdle('@idle', 500);
notifications.doDeleteNotification(rocketChatName);
cy.waitForNetworkIdle('@idle', 500);
notifications.doDeleteNotification(slackName);
});
});
2 changes: 2 additions & 0 deletions cypress/e2e/rbac/maintainer.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const task = new TaskAction();
describe('MAINTAINER permission test suites', () => {
beforeEach(() => {
cy.login(Cypress.env('user_maintainer'), Cypress.env('user_maintainer'));
registerIdleHandler('idle');
});

context('Settings', () => {
Expand All @@ -39,6 +40,7 @@ describe('MAINTAINER permission test suites', () => {

it('Deletes SSH key', () => {
cy.visit(`${Cypress.env('url')}/settings`);
cy.waitForNetworkIdle('@idle', 500);

settings.deleteSshKey(testData.ssh.name);
});
Expand Down
34 changes: 27 additions & 7 deletions cypress/support/actions/deployment/DeploymentAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,33 @@ export default class deploymentAction {
.should('include.text', 'There was a problem cancelling deployment.');
}
doLogViewerCheck() {
deployment.getAccordionHeadings().then($headings => {
for (let i = 0; i < $headings.length - 1; i++) {
cy.wrap($headings.eq(i)).click();
}

for (let i = 0; i < $headings.length - 1; i++) {
cy.wrap($headings.eq(i)).next().next().getBySel('section-details').getBySel('log-text').should('exist');
cy.get('body').then($body => {
if ($body.find('.accordion-heading').length > 0) {
// parsing went ok
cy.get('.accordion-heading')
.each(($heading, index, $headings) => {
if (index < $headings.length - 1) {
cy.wrap($heading).click();
}
})
.then($headings => {
for (let i = 0; i < $headings.length - 1; i++) {
cy.wrap($headings.eq(i))
.next()
.next()
.getBySel('section-details')
.then($sectionDetails => {
if ($sectionDetails.find('.log-text').length > 0) {
cy.wrap($sectionDetails).find('.log-text').should('exist');
} else {
cy.wrap($sectionDetails).find('.log-viewer').should('not.be.empty');
}
});
}
});
} else {
// parsing failed
cy.get('.log-viewer').should('not.be.empty');
}
});
}
Expand Down
3 changes: 1 addition & 2 deletions cypress/support/actions/settings/SettingsAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ export default class SettingAction {
}

deleteSshKey(name: string) {
settings.getDeleteBtn().click();

settings.getDeleteBtn().should('be.visible').click({ force: true, multiple: true });
cy.contains(name).should('not.exist');
}
}
2 changes: 1 addition & 1 deletion src/components/Accordion/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const Accordion: FC<AccordionProps> = ({
{columns &&
Object.keys(columns).map((item, i) => (
<div key={i} className={item}>
{columns[item]}
{(columns as { [key: string]: string })[item]}
</div>
))}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/HoverTag/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface Props {
}

// human friendly strings
const textPairs = {
const textPairs: Record<string, string> = {
deployCompletedWithWarnings: 'Completed with warnings',
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ const PaginatedTable: FC<Props> = ({
const key = numericSortOptions.key;
if (key) {
if (Array.isArray(a[key])) {
first = a[key].length as number;
second = b[key].length as number;
first = a[key].length as unknown as number;
second = b[key].length as unknown as number;
} else {
first = a[key] as unknown as number;
second = b[key] as unknown as number;
Expand All @@ -207,6 +207,7 @@ const PaginatedTable: FC<Props> = ({
if (list && listKey) {
const roleToIdx = {};
list.forEach((role, idx) => {
// @ts-ignore
roleToIdx[role] = idx;
});
//@ts-ignore
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
"jsx": "preserve"
},
"include": ["next-env.d.ts", "styled.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
"exclude": ["node_modules", "**/cypress/**"]
}

0 comments on commit bf8ff50

Please sign in to comment.