import assert from 'node:assert/strict'; import fs from 'node:fs'; import path from 'node:path'; import test from 'node:test'; const root = path.resolve(import.meta.dirname, '../..'); const page = fs.readFileSync(path.join(root, 'src/web/components/ClientOverviewPage.tsx'), 'utf8'); const feature = fs.readFileSync(path.join(root, 'src/web/features/failover/FailoverFeature.tsx'), 'utf8'); const styles = fs.readFileSync(path.join(root, 'src/web/styles/features/failover.css'), 'utf8'); test('reserve is a Gateway-only drawer immediately after subscriptions', () => { assert.match(page, / { assert.match(feature, /client-failover-heading[\s\S]*

Резервный канал<\/h2>[\s\S]* { assert.match(feature, /Ждём завершения активной работы/); assert.match(feature, /Активный трафик ·[\s\S]*transmittingConnections/); assert.match(feature, /activity\?\.blockers\.slice\(0, 2\)\.map/); assert.match(feature, /Ещё \{activity\.blockers\.length - 2\}/); assert.match(feature, /Нестабилен ·[\s\S]*Следующее решение не раньше чем через/); assert.match(feature, /switchRole && snapshot\.enabled && snapshot\.activation === 'active'/); assert.match(styles, /\.client-failover-runtime \{[^}]*min-height:\s*132px/); assert.match(styles, /@media \(prefers-reduced-motion: reduce\)[\s\S]*transition:\s*none/); });