forked from n8n-io/n8n
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
* upstream/master: (32 commits) refactor(core): Move `typeorm` operators from `PruningService` to `ExecutionRepository` (no-changelog) (n8n-io#8145) refactor(core): Move more `typeorm` operators to repositories (no-changelog) (n8n-io#8143) refactor(core): Delete unused code, and fix typings in tests (no-changelog) (n8n-io#8142) docs: Improve documentation for the toTitleCase function (no-changelog) (n8n-io#8140) refactor(core): Move all base URLs to UrlService (no-changelog) (n8n-io#8141) feat(editor): Add template Id to workflow metadata (n8n-io#8088) fix(editor): Avoid sanitizing output to search node data (n8n-io#8126) fix(editor): Prevent browser zoom when scrolling inside sticky edit mode (n8n-io#8116) refactor(core): Move some `typeorm` operators to repositories (no-changelog) (n8n-io#8139) feat(editor): Add node execution status indicator to output panel (n8n-io#8124) feat(core): Unify application components shutdown (n8n-io#8097) refactor(core): Upgrade more dependencies to remove axios 0.x (no-changelog) (n8n-io#8105) refactor(core): Move active workflows endpoints to a decorated controller class (no-changelog) (n8n-io#8101) fix(editor): Prevent canvas undo/redo when NDV is open (n8n-io#8118) fix(editor): Fix operation change failing in certain conditions (n8n-io#8114) fix(Asana Node): Omit body from GET, HEAD, and DELETE requests (n8n-io#8057) fix(Redis Trigger Node): Activating a workflow with a Redis trigger fails (n8n-io#8129) refactor(Peekalink Node): Stricter typing for Peekalink api call + Tests (no-changelog) (n8n-io#8125) fix(core): Remove circular dependency in WorkflowService and ActiveWorkflowRunner (n8n-io#8128) fix: Show public API upgrade CTA when feature is not enabled (n8n-io#8109) ...
- Loading branch information
Showing
158 changed files
with
3,659 additions
and
1,677 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
import { | ||
BannerStack, | ||
MainSidebar, | ||
WorkflowPage, | ||
visitPublicApiPage, | ||
getPublicApiUpgradeCTA, | ||
} from '../pages'; | ||
import planData from '../fixtures/Plan_data_opt_in_trial.json'; | ||
import { INSTANCE_OWNER } from '../constants'; | ||
|
||
const mainSidebar = new MainSidebar(); | ||
const bannerStack = new BannerStack(); | ||
const workflowPage = new WorkflowPage(); | ||
|
||
describe('Cloud', { disableAutoLogin: true }, () => { | ||
before(() => { | ||
const now = new Date(); | ||
const fiveDaysFromNow = new Date(now.getTime() + 5 * 24 * 60 * 60 * 1000); | ||
planData.expirationDate = fiveDaysFromNow.toJSON(); | ||
}); | ||
|
||
describe('BannerStack', () => { | ||
it('should render trial banner for opt-in cloud user', () => { | ||
cy.intercept('GET', '/rest/admin/cloud-plan', { | ||
body: planData, | ||
}).as('getPlanData'); | ||
|
||
cy.intercept('GET', '/rest/settings', (req) => { | ||
req.on('response', (res) => { | ||
res.send({ | ||
data: { ...res.body.data, deployment: { type: 'cloud' }, n8nMetadata: { userId: 1 } }, | ||
}); | ||
}); | ||
}).as('loadSettings'); | ||
|
||
cy.signin({ email: INSTANCE_OWNER.email, password: INSTANCE_OWNER.password }); | ||
|
||
cy.visit(workflowPage.url); | ||
|
||
cy.wait('@getPlanData'); | ||
|
||
bannerStack.getters.banner().should('be.visible'); | ||
|
||
mainSidebar.actions.signout(); | ||
|
||
bannerStack.getters.banner().should('not.be.visible'); | ||
|
||
cy.signin({ email: INSTANCE_OWNER.email, password: INSTANCE_OWNER.password }); | ||
|
||
cy.visit(workflowPage.url); | ||
|
||
bannerStack.getters.banner().should('be.visible'); | ||
|
||
mainSidebar.actions.signout(); | ||
}); | ||
|
||
it('should not render opt-in-trial banner for non cloud deployment', () => { | ||
cy.intercept('GET', '/rest/settings', (req) => { | ||
req.on('response', (res) => { | ||
res.send({ | ||
data: { ...res.body.data, deployment: { type: 'default' } }, | ||
}); | ||
}); | ||
}).as('loadSettings'); | ||
|
||
cy.signin({ email: INSTANCE_OWNER.email, password: INSTANCE_OWNER.password }); | ||
|
||
cy.visit(workflowPage.url); | ||
|
||
bannerStack.getters.banner().should('not.be.visible'); | ||
|
||
mainSidebar.actions.signout(); | ||
}); | ||
}); | ||
|
||
describe('Admin Home', () => { | ||
it('Should show admin button', () => { | ||
cy.intercept('GET', '/rest/settings', (req) => { | ||
req.on('response', (res) => { | ||
res.send({ | ||
data: { ...res.body.data, deployment: { type: 'cloud' }, n8nMetadata: { userId: 1 } }, | ||
}); | ||
}); | ||
}).as('loadSettings'); | ||
|
||
cy.signin({ email: INSTANCE_OWNER.email, password: INSTANCE_OWNER.password }); | ||
|
||
cy.visit(workflowPage.url); | ||
|
||
mainSidebar.getters.adminPanel().should('be.visible'); | ||
}); | ||
}); | ||
|
||
describe('Public API', () => { | ||
it('Should show upgrade CTA for Public API if user is trialing', () => { | ||
cy.intercept('GET', '/rest/admin/cloud-plan', { | ||
body: planData, | ||
}).as('getPlanData'); | ||
|
||
cy.intercept('GET', '/rest/settings', (req) => { | ||
req.on('response', (res) => { | ||
res.send({ | ||
data: { | ||
...res.body.data, | ||
deployment: { type: 'cloud' }, | ||
n8nMetadata: { userId: 1 }, | ||
}, | ||
}); | ||
}); | ||
}).as('loadSettings'); | ||
|
||
cy.signin({ email: INSTANCE_OWNER.email, password: INSTANCE_OWNER.password }); | ||
|
||
visitPublicApiPage(); | ||
|
||
getPublicApiUpgradeCTA().should('be.visible'); | ||
}); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.