import test from 'node:test'; import assert from 'node:assert/strict'; import { readFileSync } from 'node:fs'; const page = readFileSync(new URL('../js/pages/notifications-view.js', import.meta.url), 'utf8'); const css = readFileSync(new URL('../styles/features/notifications.css', import.meta.url), 'utf8'); test('уведомление показывает логин автора под отображаемым именем', () => { assert.match(page, /notification-card__login/); assert.match(page, /login\.textContent = item\.sourceLogin/); assert.match(css, /\.notification-card__login/); }); test('ответная связь повторяет тип входящей связи', () => { assert.match(page, /CONNECTION_CLOSE_FRIEND[\s\S]*\? 'close_friend'[\s\S]*: 'friend'/); assert.match(page, /kind, enabled: true/); assert.match(page, /text_072/); assert.match(page, /text_073/); });