fix: Adjust set up template button styles (no-changelog) (#8259)

This commit is contained in:
Tomi Turtiainen 2024-01-08 16:34:28 +02:00 committed by GitHub
parent fc2903096e
commit 38d91c43e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 10 deletions

View file

@ -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")`);

View file

@ -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}`, {
@ -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', () => {
@ -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();
});
});
});

View file

@ -65,6 +65,8 @@ onBeforeUnmount(() => {
v-if="showButton"
:label="i18n.baseText('nodeView.setupTemplate')"
size="large"
icon="box-open"
type="secondary"
@click="handleClick()"
/>
</template>

View file

@ -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",