27 lines
885 B
JavaScript
27 lines
885 B
JavaScript
'use strict';
|
|
|
|
const assert = require('assert');
|
|
const { _private } = require('../src/services/aistudio_api_key_service');
|
|
|
|
assert.strictEqual(
|
|
_private.isAdditionalConsentText('Go Further. Build Smarter: Unlock more possibilities with Google AI plans now in AI Studio.'),
|
|
true,
|
|
'新版无复选框附加条款必须被识别',
|
|
);
|
|
assert.strictEqual(
|
|
_private.INITIAL_CONSENT_WAIT_MS,
|
|
2500,
|
|
'已同意账号只保留 2.5 秒首次弹窗观察窗口,延迟条款由创建表单阶段二次检测',
|
|
);
|
|
assert.strictEqual(
|
|
_private.isAdditionalConsentText('The Gemini API Additional Terms of Service and the Google Privacy Policy apply.'),
|
|
true,
|
|
);
|
|
assert.strictEqual(
|
|
_private.isAdditionalConsentText('Create API key in existing project'),
|
|
false,
|
|
'创建 Key 对话框不能被误当成条款弹窗',
|
|
);
|
|
|
|
console.log('aistudio_additional_consent.test.js: PASS');
|