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.
fix(editor): Move versions check to init function and refactor store …
…(no-changelog) (n8n-io#8067)
- Loading branch information
1 parent
faadfd6
commit fcff34c
Showing
10 changed files
with
224 additions
and
85 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* Getters | ||
*/ | ||
|
||
export function getVersionUpdatesPanelOpenButton() { | ||
return cy.getByTestId('version-updates-panel-button'); | ||
} | ||
|
||
export function getVersionUpdatesPanel() { | ||
return cy.getByTestId('version-updates-panel'); | ||
} | ||
|
||
export function getVersionUpdatesPanelCloseButton() { | ||
return getVersionUpdatesPanel().get('.el-drawer__close-btn').first(); | ||
} | ||
|
||
export function getVersionCard() { | ||
return cy.getByTestId('version-card'); | ||
} | ||
|
||
/** | ||
* Actions | ||
*/ | ||
|
||
export function openVersionUpdatesPanel() { | ||
getVersionUpdatesPanelOpenButton().click(); | ||
getVersionUpdatesPanel().should('be.visible'); | ||
} | ||
|
||
export function closeVersionUpdatesPanel() { | ||
getVersionUpdatesPanelCloseButton().click(); | ||
} |
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,66 @@ | ||
import { INSTANCE_OWNER } from '../constants'; | ||
import { WorkflowsPage } from '../pages/workflows'; | ||
import { | ||
closeVersionUpdatesPanel, | ||
getVersionCard, | ||
getVersionUpdatesPanelOpenButton, | ||
openVersionUpdatesPanel, | ||
} from '../composables/versions'; | ||
|
||
const workflowsPage = new WorkflowsPage(); | ||
|
||
describe('Versions', () => { | ||
it('should open updates panel', () => { | ||
cy.intercept('GET', '/rest/settings', (req) => { | ||
req.continue((res) => { | ||
if (res.body.hasOwnProperty('data')) { | ||
res.body.data = { | ||
...res.body.data, | ||
releaseChannel: 'stable', | ||
versionCli: '1.0.0', | ||
versionNotifications: { | ||
enabled: true, | ||
endpoint: 'https://api.n8n.io/api/versions/', | ||
infoUrl: 'https://docs.n8n.io/getting-started/installation/updating.html', | ||
}, | ||
}; | ||
} | ||
}); | ||
}).as('settings'); | ||
|
||
cy.intercept('GET', 'https://api.n8n.io/api/versions/1.0.0', [ | ||
{ | ||
name: '1.3.1', | ||
createdAt: '2023-08-18T11:53:12.857Z', | ||
hasSecurityIssue: null, | ||
hasSecurityFix: null, | ||
securityIssueFixVersion: null, | ||
hasBreakingChange: null, | ||
documentationUrl: 'https://docs.n8n.io/release-notes/#n8n131', | ||
nodes: [], | ||
description: 'Includes <strong>bug fixes</strong>', | ||
}, | ||
{ | ||
name: '1.0.5', | ||
createdAt: '2023-07-24T10:54:56.097Z', | ||
hasSecurityIssue: false, | ||
hasSecurityFix: null, | ||
securityIssueFixVersion: null, | ||
hasBreakingChange: true, | ||
documentationUrl: 'https://docs.n8n.io/release-notes/#n8n104', | ||
nodes: [], | ||
description: 'Includes <strong>core functionality</strong> and <strong>bug fixes</strong>', | ||
}, | ||
]); | ||
|
||
cy.signin(INSTANCE_OWNER); | ||
|
||
cy.visit(workflowsPage.url); | ||
cy.wait('@settings'); | ||
|
||
getVersionUpdatesPanelOpenButton().should('contain', '2 updates'); | ||
openVersionUpdatesPanel(); | ||
getVersionCard().should('have.length', 2); | ||
closeVersionUpdatesPanel(); | ||
}); | ||
}); |
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
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.