From 1993f7b4b1009fbbe4cc44ed72be99aac70394b7 Mon Sep 17 00:00:00 2001 From: Panfilov Konstantin Date: Wed, 28 Oct 2026 05:03:05 +0300 Subject: [PATCH] =?UTF-8?q?api#347:=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80?= =?UTF-8?q?=D0=B8=D1=82=D1=8C=20=D1=81=D1=82=D0=B0=D1=80=D1=8B=D0=B5=20rec?= =?UTF-8?q?overy=20snapshots=20=D1=81=20default2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/check-preland-footer.php | 4 ++-- tests/e2e/utm-handoff.cjs | 8 ++++++++ tests/render-preland.php | 1 - 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/check-preland-footer.php b/tests/check-preland-footer.php index 1ab71eb..6706534 100644 --- a/tests/check-preland-footer.php +++ b/tests/check-preland-footer.php @@ -1,13 +1,13 @@ 'zoomstage.online', 'New-Preland.example:8080' => 'new-preland.example', 'www.example.test.' => 'www.example.test', '' => 'fixture.local', ] as $host => $expected) { - $html = shell_exec(PHP_BINARY . ' ' . escapeshellarg(__DIR__ . '/render-preland.php') . ' ' . escapeshellarg($host) . ' ' . escapeshellarg($theme) . ' ' . escapeshellarg($part) . ' ' . escapeshellarg($lang)); + $html = shell_exec(PHP_BINARY . ' ' . escapeshellarg(__DIR__ . '/render-preland.php') . ' ' . escapeshellarg($host) . ' ' . escapeshellarg($theme) . ' ' . escapeshellarg($part)); if (!preg_match('~~s', $html, $match)) throw new RuntimeException('Подвал не найден'); $footer = $match[0]; foreach (['Наши реквизиты', 'payment.svg', 'ИНН:', 'ОГРНИП:', 'ИП Иванов', 'ИП Кардаполова', 'Для бизнеса', '/public/api-pricing'] as $forbidden) { diff --git a/tests/e2e/utm-handoff.cjs b/tests/e2e/utm-handoff.cjs index 507aa66..273d2c7 100644 --- a/tests/e2e/utm-handoff.cjs +++ b/tests/e2e/utm-handoff.cjs @@ -41,3 +41,11 @@ for (const part of ['abcd9','abcd0','bad']) { assert.equal(query.get('part')[4],'1'); } assert.equal(new URLSearchParams(handoff.query({utmDigits:{...defaults,part:'9'}},defaults)).get('part')[4],'1'); +// Старые recovery-records используют тот же fallback текущего resolved snapshot, что остальные метки. +const configuredDefault2={...defaults,part:'2'}; +const oldDigits={...selected};delete oldDigits.part; +const oldRecord={redirectUtm:foreign,utmDigits:oldDigits}; +assert.equal(new URLSearchParams(handoff.query(oldRecord,configuredDefault2)).get('part')[4],'2'); +assert.equal(new URLSearchParams(handoff.query({...oldRecord,utmDigits:{...oldDigits,part:'1'}},configuredDefault2)).get('part')[4],'1'); +assert.equal(new URLSearchParams(handoff.query({...oldRecord,redirectUtm:foreign+'&part=abcd1'},configuredDefault2)).get('part')[4],'1'); +console.log('OK: old recovery configured default2; saved snapshot/query retains priority'); \ No newline at end of file diff --git a/tests/render-preland.php b/tests/render-preland.php index e46bb17..31cfaa1 100644 --- a/tests/render-preland.php +++ b/tests/render-preland.php @@ -4,5 +4,4 @@ $_SERVER['HTTP_HOST'] = $argv[1] ?? 'zoomstage.online'; $_SERVER['SERVER_NAME'] = 'fixture.local'; $_GET = ['theme' => 'abcd' . (($argv[2] ?? 'light') === 'dark' ? '1' : '2'), 'indpic' => 'abcd1']; if (isset($argv[3])) $_GET['part'] = $argv[3]; -if (isset($argv[4])) $_GET['lang'] = $argv[4]; require dirname(__DIR__) . '/index.php';