mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-02 07:01:30 -08:00
fix(editor): Update image sizes in template description not to be full width always (#8037)
## Summary Update image sizes in template description not to be full width always. ## Related tickets and issues https://linear.app/n8n/issue/ADO-1506/bug-fix-images-in-template-descriptions ## Review / Merge checklist - [X] PR title and summary are descriptive. **Remember, the title automatically goes into the changelog. Use `(no-changelog)` otherwise.** ([conventions](https://github.com/n8n-io/n8n/blob/master/.github/pull_request_title_conventions.md)) - [ ] [Docs updated](https://github.com/n8n-io/n8n-docs) or follow-up ticket created. - [x] Tests included. > A bug is not considered fixed, unless a test is added to prevent it from happening again. > A feature is not complete without tests.
This commit is contained in:
parent
62ce962ec9
commit
63a6e7e034
|
@ -2,9 +2,12 @@ import { TemplatesPage } from '../pages/templates';
|
||||||
import { WorkflowPage } from '../pages/workflow';
|
import { WorkflowPage } from '../pages/workflow';
|
||||||
|
|
||||||
import OnboardingWorkflow from '../fixtures/Onboarding_workflow.json';
|
import OnboardingWorkflow from '../fixtures/Onboarding_workflow.json';
|
||||||
|
import WorkflowTemplate from '../fixtures/Workflow_template_write_http_query.json';
|
||||||
|
import { TemplateWorkflowPage } from '../pages/template-workflow';
|
||||||
|
|
||||||
const templatesPage = new TemplatesPage();
|
const templatesPage = new TemplatesPage();
|
||||||
const workflowPage = new WorkflowPage();
|
const workflowPage = new WorkflowPage();
|
||||||
|
const templateWorkflowPage = new TemplateWorkflowPage();
|
||||||
|
|
||||||
describe('Templates', () => {
|
describe('Templates', () => {
|
||||||
it('can open onboarding flow', () => {
|
it('can open onboarding flow', () => {
|
||||||
|
@ -31,4 +34,10 @@ describe('Templates', () => {
|
||||||
workflowPage.getters.stickies().should('have.length', 1);
|
workflowPage.getters.stickies().should('have.length', 1);
|
||||||
workflowPage.actions.shouldHaveWorkflowName(OnboardingWorkflow.name);
|
workflowPage.actions.shouldHaveWorkflowName(OnboardingWorkflow.name);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('can open template with images and hides workflow screenshots', () => {
|
||||||
|
templateWorkflowPage.actions.openTemplate(WorkflowTemplate);
|
||||||
|
|
||||||
|
templateWorkflowPage.getters.description().find('img').should('have.length', 1);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
188
cypress/fixtures/Workflow_template_write_http_query.json
Normal file
188
cypress/fixtures/Workflow_template_write_http_query.json
Normal file
File diff suppressed because one or more lines are too long
|
@ -5,6 +5,7 @@ export class TemplateWorkflowPage extends BasePage {
|
||||||
|
|
||||||
getters = {
|
getters = {
|
||||||
useTemplateButton: () => cy.get('[data-test-id="use-template-button"]'),
|
useTemplateButton: () => cy.get('[data-test-id="use-template-button"]'),
|
||||||
|
description: () => cy.get('[data-test-id="template-description"]')
|
||||||
};
|
};
|
||||||
|
|
||||||
actions = {
|
actions = {
|
||||||
|
@ -15,5 +16,15 @@ export class TemplateWorkflowPage extends BasePage {
|
||||||
clickUseThisWorkflowButton: () => {
|
clickUseThisWorkflowButton: () => {
|
||||||
this.getters.useTemplateButton().click();
|
this.getters.useTemplateButton().click();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
openTemplate: (template: {workflow: {id: number, name: string, description: string, user: {username: string}, image: {id: number, url: string}[] }}) => {
|
||||||
|
cy.intercept('GET', `https://api.n8n.io/api/templates/workflows/${template.workflow.id}`, {
|
||||||
|
statusCode: 200,
|
||||||
|
body: template,
|
||||||
|
}).as('getTemplate');
|
||||||
|
|
||||||
|
this.actions.visit(template.workflow.id);
|
||||||
|
cy.wait('@getTemplate');
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -247,10 +247,7 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
width: 100%;
|
max-width: 100%;
|
||||||
max-height: 90vh;
|
|
||||||
object-fit: cover;
|
|
||||||
border: var(--border-width-base) var(--color-foreground-base) var(--border-style-base);
|
|
||||||
border-radius: var(--border-radius-large);
|
border-radius: var(--border-radius-large);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div :class="$style.content">
|
<div :class="$style.content">
|
||||||
<div :class="$style.markdown">
|
<div :class="$style.markdown" data-test-id="template-description">
|
||||||
<n8n-markdown
|
<n8n-markdown
|
||||||
:content="template && template.description"
|
:content="template && template.description"
|
||||||
:images="template && template.image"
|
:images="template && template.image"
|
||||||
|
|
Loading…
Reference in a new issue