Skip to content

Commit

Permalink
fix: Adjust set up template button styles (no-changelog) (#8259)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomi authored Jan 8, 2024
1 parent fc29030 commit 38d91c4
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cypress/composables/setup-workflow-credentials-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
* Getters
*/

export const getSetupWorkflowCredentialsButton = () => cy.get(`button:contains("Set up Template")`);
export const getSetupWorkflowCredentialsButton = () => cy.get(`button:contains("Set up template")`);
22 changes: 14 additions & 8 deletions cypress/e2e/34-template-credentials-setup.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@ const workflowPage = new WorkflowPage();

const testTemplate = templateCredentialsSetupPage.testData.simpleTemplate;

// NodeView uses beforeunload listener that will show a browser
// native popup, which will block cypress from continuing / exiting.
// This prevent the registration of the listener.
Cypress.on('window:before:load', (win) => {
const origAddEventListener = win.addEventListener;
win.addEventListener = (eventName: string, listener: any, opts: any) => {
if (eventName === 'beforeunload') {
return;
}

return origAddEventListener.call(win, eventName, listener, opts);
};
});

describe('Template credentials setup', () => {
beforeEach(() => {
cy.intercept('GET', `https://api.n8n.io/api/templates/workflows/${testTemplate.id}`, {
Expand Down Expand Up @@ -159,10 +173,6 @@ describe('Template credentials setup', () => {
templateCredentialsSetupPage.getters.skipLink().click();

getSetupWorkflowCredentialsButton().should('be.visible');

// We need to save the workflow or otherwise a browser native popup
// will block cypress from continuing
workflowPage.actions.saveWorkflowOnButtonClick();
});

it('should allow credential setup from workflow editor if user fills in credentials partially during template setup', () => {
Expand Down Expand Up @@ -203,10 +213,6 @@ describe('Template credentials setup', () => {
});

getSetupWorkflowCredentialsButton().should('not.exist');

// We need to save the workflow or otherwise a browser native popup
// will block cypress from continuing
workflowPage.actions.saveWorkflowOnButtonClick();
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ onBeforeUnmount(() => {
v-if="showButton"
:label="i18n.baseText('nodeView.setupTemplate')"
size="large"
icon="box-open"
type="secondary"
@click="handleClick()"
/>
</template>
2 changes: 1 addition & 1 deletion packages/editor-ui/src/plugins/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,7 @@
"nodeView.zoomOut": "Zoom Out",
"nodeView.zoomToFit": "Zoom to Fit",
"nodeView.replaceMe": "Replace Me",
"nodeView.setupTemplate": "Set up Template",
"nodeView.setupTemplate": "Set up template",
"contextMenu.node": "node | nodes",
"contextMenu.sticky": "sticky note | sticky notes",
"contextMenu.selectAll": "Select all",
Expand Down

0 comments on commit 38d91c4

Please sign in to comment.