SHA256
НЕ ПРОВЕРЕНО: учтены логины с большими и маленькими буквами. Добавлен временный devnet-смарт-контракт для очистки тестового аккаунта от старых логинов; после сброса его необходимо удалить и восстановить штатный контракт.
12 lines
888 B
JavaScript
12 lines
888 B
JavaScript
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import fs from 'node:fs';
|
|
const schema = fs.readFileSync(new URL('../../SHiNE-server/shine-server-db/src/main/resources/postgres/schema_v1.sql', import.meta.url), 'utf8');
|
|
const current = schema.slice(schema.lastIndexOf('CREATE OR REPLACE FUNCTION shine_blocks_connection_state_ai() RETURNS TRIGGER'));
|
|
test('социальные проекции нормализуют target, не изменяя блоки', () => {
|
|
assert.match(current, /VALUES\(lower\(NEW\.login\),1,lower\(NEW\.to_login\),/);
|
|
assert.match(current, /WHERE from_login=lower\(NEW\.login\)/);
|
|
assert.match(current, /INSERT INTO message_stats\(to_login,to_block_number,to_block_hash,replies_count\)[\s\S]*?VALUES\(lower\(NEW\.to_login\),/);
|
|
assert.match(current, /VALUES\(lower\(NEW\.login\),NEW\.msg_sub_type,lower\(NEW\.to_login\),/);
|
|
});
|