SHA256
Доработать исследователь сети и кошелёк
This commit is contained in:
@@ -131,3 +131,24 @@ test('V3: сияние не стирает тип связи у красно-с
|
||||
assert.equal(edge.reverseRelationType, 'close_friend');
|
||||
assert.equal(find(g.snapshot('a', { depth: 0 }), 'b').shining, true);
|
||||
});
|
||||
|
||||
test('V3/V4: история с постоянно включённым X2 меняет радиус 5 ↔ 2, не удаляя граф', () => {
|
||||
const g = createExplorerGraph();
|
||||
for (const [a, b] of [['a','b'], ['b','c'], ['c','d'], ['d','e'], ['e','f'], ['f','g']]) {
|
||||
g.add(friends(a, [b]));
|
||||
}
|
||||
const ids = (depth) => g.snapshot('a', { x2: true, depth }).nodes.map((node) => node.id);
|
||||
assert.deepEqual(ids(3), ['a','b','c','d','e','f']);
|
||||
assert.deepEqual(ids(0), ['a','b','c']);
|
||||
assert.deepEqual(ids(3), ['a','b','c','d','e','f']);
|
||||
});
|
||||
|
||||
test('V3/V4: оба фильтра работают совместно и могут отключаться независимо', () => {
|
||||
const g = createExplorerGraph();
|
||||
g.add(friends('a', ['b'], ['c', 'd'], [], [['b', true], ['c', true], ['d', false]]));
|
||||
const ids = (close, shining) => g.snapshot('a', { x2: true, depth: 3, close, shining }).nodes.map((node) => node.id).sort();
|
||||
assert.deepEqual(ids(true, true), ['a','c']);
|
||||
assert.deepEqual(ids(false, true), ['a','b','c']);
|
||||
assert.deepEqual(ids(true, false), ['a','c','d']);
|
||||
assert.deepEqual(ids(false, false), ['a','b','c','d']);
|
||||
});
|
||||
|
||||
@@ -116,3 +116,23 @@ test('V4 Canvas открывается по умолчанию, но ранее
|
||||
assert.match(switcher, /const DEFAULT_MODE = 'explorer-canvas';/);
|
||||
assert.match(switcher, /MODES\.has\(saved\) \? saved : DEFAULT_MODE/);
|
||||
});
|
||||
|
||||
test('V3/V4: defaults, dynamic menu, active-only chips and self-centering contract', () => {
|
||||
const view = readFileSync(new URL('../js/pages/network-explorer/network-view.js', import.meta.url), 'utf8');
|
||||
const dropdown = readFileSync(new URL('../js/components/dropdown-menu.js', import.meta.url), 'utf8');
|
||||
const renderer = readFileSync(new URL('../js/pages/network-canvas-v4/graph-renderer.js', import.meta.url), 'utf8');
|
||||
assert.match(view, /depth: 3, x2: true, close: false, shining: false/);
|
||||
assert.doesNotMatch(view, /x2Chip|depthChip|session\.compact|session\.x2\s*=/);
|
||||
assert.match(view, /session\.depth = session\.depth === 3 \? 0 : 3/);
|
||||
assert.match(view, /toolbar\.replaceChildren\(\)/);
|
||||
assert.match(view, /if \(!session\[key\]\) continue/);
|
||||
assert.match(view, /toolbar\.hidden = !session\.close && !session\.shining/);
|
||||
assert.match(view, /items: \(\) => \[/);
|
||||
assert.match(view, /checked: session\.close, action: \(\) => toggleFilter\('close'\)/);
|
||||
assert.match(view, /checked: session\.shining, action: \(\) => toggleFilter\('shining'\)/);
|
||||
assert.match(view, /checked: session\.depth === 3, action: toggleHistory/);
|
||||
assert.match(view, /function showMe\(\)[\s\S]*?void load\(login, true\);\s*engine\?\.centerCamera\?\.\(\)/);
|
||||
assert.match(dropdown, /'menuitemcheckbox'/);
|
||||
assert.match(dropdown, /setAttribute\('aria-checked', String\(item\.checked\)\)/);
|
||||
assert.match(renderer, /centerCamera: \(\) => \{[\s\S]*?camX = -\(node\?\.x \|\| 0\) \* zoom/);
|
||||
});
|
||||
|
||||
@@ -24,8 +24,9 @@ test('menu opens existing DAO donation dialog without navigating to the Solana b
|
||||
assert.match(menu, /support_project_label/);
|
||||
assert.doesNotMatch(ui, /id="donate-shine"/, 'Solana wallet must not duplicate the donation button');
|
||||
const order = ['renderSolanaWallet()', 'renderArweaveWallet()', 'renderTurboWallet()',
|
||||
'openShineSupportDialog()', 'renderShineBlockchainWallet()', 'renderSupportHub()']
|
||||
'openShineSupportDialog()', 'renderSupportHub()']
|
||||
.map((entry) => menu.indexOf(entry));
|
||||
assert.doesNotMatch(menu, /renderShineBlockchainWallet|wallet_view\.text_122/);
|
||||
assert.ok(order.every((position) => position >= 0));
|
||||
assert.deepEqual(order, [...order].sort((a, b) => a - b));
|
||||
assert.match(menu, /\(\) => openShineSupportDialog\(\)/);
|
||||
|
||||
@@ -85,6 +85,9 @@ test('chat transfer fixes recipient; wallet transfer has only free-address entry
|
||||
assert.match(transfer, /const recipientLogin = recipientFromRoute;/);
|
||||
assert.match(transfer, /q\('recipient'\)\.readOnly = true;/);
|
||||
assert.match(transfer, /q\('notify-row'\)\.hidden = !recipientFromRoute;/);
|
||||
assert.match(transfer, /q\('notify'\)\.checked = Boolean\(recipientFromRoute\);/);
|
||||
assert.match(transfer, /const messageWanted = q\('notify'\)\.checked;/);
|
||||
assert.match(transfer, /if \(messageWanted && recipientLogin\)/);
|
||||
assert.match(transfer, /if \(recipientLogin\) \{/);
|
||||
assert.match(transfer, /toAddress = await resolveContactBlockchainAddress\(recipientLogin, endpoint\);/);
|
||||
assert.doesNotMatch(transfer, /data-clear-contact|data-search|data-contacts|wallet-transfer-contact-picker|authService\.listContacts/);
|
||||
|
||||
Reference in New Issue
Block a user