test: Reset DB and skip set-up before running node creator e2e (#4733)

* test: Reset DB and skip set-up before runing

* remove second db:reset call in node-creator e2e spec
This commit is contained in:
OlegIvaniv 2022-11-25 17:01:49 +01:00 committed by GitHub
parent cb3bfc32f7
commit 2d31720b82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 21 deletions

View file

@ -1,16 +1,14 @@
import { DEFAULT_USER_EMAIL, DEFAULT_USER_PASSWORD } from "../constants";
import { randFirstName, randLastName } from "@ngneat/falso";
import { NodeCreator } from '../pages/features/node-creator';
import { INodeTypeDescription } from '../../packages/workflow';
import CustomNodeFixture from '../fixtures/Custom_node.json';
const username = DEFAULT_USER_EMAIL;
const password = DEFAULT_USER_PASSWORD;
const firstName = randFirstName();
const lastName = randLastName();
const nodeCreatorFeature = new NodeCreator();
describe('Node Creator', () => {
before(() => {
cy.task('db:reset');
})
beforeEach(() => {
cy.intercept('GET', '/types/nodes.json', (req) => {
// Delete caching headers so that we can intercept the request
@ -24,16 +22,6 @@ describe('Node Creator', () => {
res.send(nodes)
})
}).as('nodesIntercept')
cy.signup(username, firstName, lastName, password);
cy.on('uncaught:exception', (err, runnable) => {
expect(err.message).to.include('Not logged in');
return false;
})
cy.signin(username, password);
cy.visit(nodeCreatorFeature.url);
});
@ -100,7 +88,7 @@ describe('Node Creator', () => {
cy.get('div').contains("On clicking 'execute'").should('exist');
})
it('check if non-core nodes are rendered all nodes', () => {
it('check if non-core nodes are rendered', () => {
cy.wait('@nodesIntercept').then((interception) => {
const nodes = interception.response?.body as INodeTypeDescription[];
@ -126,9 +114,9 @@ describe('Node Creator', () => {
})
})
it.only('should render and select community node', () => {
it('should render and select community node', () => {
cy.wait('@nodesIntercept').then(() => {
const customCategory = 'customCategory';
const customCategory = 'Custom Category';
const customNode = 'E2E Node';
const customNodeDescription = 'Demonstrate rendering of node';

View file

@ -38,7 +38,7 @@
"transform"
],
"codex": {
"categories": ["CustomCategory"]
"categories": ["Custom Category"]
},
"version": 1,
"description": "Demonstrate rendering of node",

View file

@ -68,7 +68,7 @@ export default Vue.extend({
renderCategoryName(categoryName: CategoryName) {
const key = `nodeCreator.categoryNames.${categoryName}` as const;
return this.$locale.exists(key) ? this.$locale.baseText(key) : categoryName;
return this.$locale.exists(key) ? this.$locale.baseText(key) : this.item.category;
},
},
});