mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 05:29:26 +08:00
chore(e2e): make e2e more stable
This commit is contained in:
parent
00b7e0e0bd
commit
980f4d8919
@ -310,8 +310,6 @@ const InternalSchemaToolbar: FC<SchemaToolbarProps> = React.memo((props) => {
|
||||
}, [schemaSettingsExists, schemaSettingsRender, settings]);
|
||||
const toolbarRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
const hiddenClassName = process.env.__E2E__ ? 'hidden-e2e' : 'hidden';
|
||||
|
||||
useEffect(() => {
|
||||
const toolbarElement = toolbarRef.current;
|
||||
let parentElement = toolbarElement?.parentElement;
|
||||
@ -327,14 +325,22 @@ const InternalSchemaToolbar: FC<SchemaToolbarProps> = React.memo((props) => {
|
||||
|
||||
function show() {
|
||||
if (toolbarElement) {
|
||||
toolbarElement.classList.remove(hiddenClassName);
|
||||
if (process.env.__E2E__) {
|
||||
toolbarElement.style.display = 'block';
|
||||
} else {
|
||||
toolbarElement.classList.remove('hidden');
|
||||
}
|
||||
props.onVisibleChange?.(true);
|
||||
}
|
||||
}
|
||||
|
||||
function hide() {
|
||||
if (toolbarElement) {
|
||||
toolbarElement.classList.add(hiddenClassName);
|
||||
if (process.env.__E2E__) {
|
||||
toolbarElement.style.display = 'none';
|
||||
} else {
|
||||
toolbarElement.classList.add('hidden');
|
||||
}
|
||||
props.onVisibleChange?.(false);
|
||||
}
|
||||
}
|
||||
|
@ -31,10 +31,6 @@ export const useStyles = genStyleHook('nb-schema-toolbar', (token) => {
|
||||
pointerEvents: 'none',
|
||||
},
|
||||
|
||||
'&.hidden-e2e': {
|
||||
display: 'none',
|
||||
},
|
||||
|
||||
'.ant-space-item .anticon': {
|
||||
margin: 0,
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user