feat: preserve focus and catalog context during public navigation
Quality / test (push) Canceled after 0s
Quality / test (push) Canceled after 0s
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import { catalogReturnPath } from '../src/services/public-navigation.js';
|
||||
|
||||
test('retains catalog filters and rejects external or non-catalog return URLs', () => {
|
||||
assert.equal(catalogReturnPath('/?q=Pikachu%20ex&page=2'), '/?q=Pikachu%20ex&page=2');
|
||||
for (const value of [undefined, ['/?q=a'], '//example.test', '/\\example.test', 'https://example.test', '/admin', '/listings/1']) {
|
||||
assert.equal(catalogReturnPath(value), '/');
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user