mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-22 12:36:24 +08:00
test: add e2e test for validation of editor version
This commit is contained in:
@@ -12,11 +12,19 @@ type Config = {
|
||||
|
||||
const nextConfig = getConfig();
|
||||
const publicRuntimeConfig: Config = nextConfig.publicRuntimeConfig;
|
||||
|
||||
const setAffineAppProperties = () => {
|
||||
const input = document.createElement('input');
|
||||
const id = 'editor-version';
|
||||
if (document.getElementById(id)) {
|
||||
return;
|
||||
}
|
||||
input.value = publicRuntimeConfig.EDITOR_VERSION;
|
||||
input.type = 'hidden';
|
||||
input.id = id;
|
||||
input.setAttribute('data-testid', 'editor-version');
|
||||
document.body.appendChild(input);
|
||||
};
|
||||
const printBuildInfo = () => {
|
||||
// if (isDev) {
|
||||
// return;
|
||||
// }
|
||||
console.group('Build info');
|
||||
console.log('Project:', publicRuntimeConfig.PROJECT_NAME);
|
||||
console.log(
|
||||
@@ -30,6 +38,7 @@ const printBuildInfo = () => {
|
||||
`${publicRuntimeConfig.NODE_ENV}${publicRuntimeConfig.CI ? '(ci)' : ''}`
|
||||
);
|
||||
console.log('Editor Version:', publicRuntimeConfig.EDITOR_VERSION);
|
||||
|
||||
console.log('Version:', publicRuntimeConfig.VERSION);
|
||||
console.log(
|
||||
'AFFiNE is an open source project, you can view its source code on GitHub!'
|
||||
@@ -38,8 +47,8 @@ const printBuildInfo = () => {
|
||||
`https://github.com/toeverything/AFFiNE/tree/${publicRuntimeConfig.COMMIT_HASH}`
|
||||
);
|
||||
console.groupEnd();
|
||||
|
||||
setAffineAppProperties();
|
||||
};
|
||||
|
||||
printBuildInfo();
|
||||
|
||||
export {};
|
||||
export { printBuildInfo };
|
||||
|
||||
Reference in New Issue
Block a user