test(site-builder): parity harness neutralises documented editor-only differences (empty drop zone, empty-image placeholder)
Container marks the applied drop zone with data-wsb-dropzone. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d75f9d90ca
commit
ae02eb7d0d
3 files changed
+22
No files matched your search
@@ -31,3 +31,11 @@ describe('Container empty-only drop zone', () => {
|
||||
expect(mount({ style: { minHeight: '100px' } }, false).style.minHeight).toBe('100px');
|
||||
});
|
||||
});
|
||||
|
||||
describe('data-wsb-dropzone marker (harness hook)', () => {
|
||||
test('set only while the drop-zone min-height is the one applied', () => {
|
||||
expect(mount({ style: {} }, false).hasAttribute('data-wsb-dropzone')).toBe(true);
|
||||
expect(mount({ style: {} }, true).hasAttribute('data-wsb-dropzone')).toBe(false);
|
||||
expect(mount({ style: { minHeight: '100px' } }, false).hasAttribute('data-wsb-dropzone')).toBe(false);
|
||||
});
|
||||
});
|
||||
@@ -117,6 +117,7 @@ export const Container: UserComponent<ContainerProps> = ({
|
||||
style: outerStyle,
|
||||
'data-craft-container': 'true',
|
||||
'data-fullwidth': fullWidth ? '' : undefined,
|
||||
'data-wsb-dropzone': isEmpty && !style.minHeight ? '' : undefined,
|
||||
id: idValue,
|
||||
className: cssClass || undefined,
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user