mirror of
https://github.com/Matysh/houseplan-card
synced 2026-09-30 19:58:50 +00:00
@@ -0,0 +1,19 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import {
|
||||
helpHasContent,
|
||||
helpScrollShouldDismiss,
|
||||
} from '../test-build/help-behavior.js';
|
||||
|
||||
test('help is absent unless both visible copy and an accessible name exist', () => {
|
||||
assert.equal(helpHasContent('Explanation', 'More information'), true);
|
||||
assert.equal(helpHasContent(' ', 'More information'), false);
|
||||
assert.equal(helpHasContent('Explanation', ''), false);
|
||||
assert.equal(helpHasContent(null, 'More information'), false);
|
||||
});
|
||||
|
||||
test('only scrolling the owning dialog outside the floating surface dismisses help', () => {
|
||||
assert.equal(helpScrollShouldDismiss(true, true), false);
|
||||
assert.equal(helpScrollShouldDismiss(false, true), true);
|
||||
assert.equal(helpScrollShouldDismiss(false, false), false);
|
||||
});
|
||||
Reference in New Issue
Block a user