Add direct gateway forwarding when VPN is off
This commit is contained in:
@@ -3,6 +3,7 @@ import test from 'node:test';
|
||||
|
||||
import {
|
||||
connectionAction,
|
||||
copyText,
|
||||
formatConnectionDuration,
|
||||
localProxyUrls,
|
||||
subscriptionDomain,
|
||||
@@ -54,6 +55,26 @@ test('gateway proxy URLs use its network address', () => {
|
||||
});
|
||||
});
|
||||
|
||||
test('copy uses the synchronous native path available on gateway HTTP', async () => {
|
||||
const textarea = {
|
||||
style: {},
|
||||
setAttribute() {},
|
||||
select() { this.selected = true; },
|
||||
remove() { this.removed = true; },
|
||||
};
|
||||
const documentRef = {
|
||||
body: { append(node) { node.appended = true; } },
|
||||
createElement: () => textarea,
|
||||
execCommand: (command) => command === 'copy',
|
||||
};
|
||||
|
||||
await copyText('192.168.50.111', { documentRef });
|
||||
|
||||
assert.equal(textarea.value, '192.168.50.111');
|
||||
assert.equal(textarea.selected, true);
|
||||
assert.equal(textarea.removed, true);
|
||||
});
|
||||
|
||||
test('subscription usage combines traffic and caps progress', () => {
|
||||
assert.deepEqual(subscriptionUsage({ upload: 30, download: 80, total: 100, expire: 2 }), {
|
||||
upload: 30,
|
||||
|
||||
Reference in New Issue
Block a user