Pause browser local AI behind disabled feature flag
Build and publish frontend / publish (push) Failing after 2s
Build and publish frontend / publish (push) Failing after 2s
This commit is contained in:
@@ -5,9 +5,12 @@ const test = require('node:test');
|
||||
|
||||
const page = fs.readFileSync(path.join(__dirname, '..', 'index.html'), 'utf8');
|
||||
|
||||
test('local AI adapter comes from the static service and starts after authenticated game entry', () => {
|
||||
assert.match(page, /<script src="\/static\/wllama-gemma3-v2\/local-ai\.js"><\/script>/);
|
||||
assert.match(page, /showPlay\(\);\s*if \(!currentAccount\.is_admin\) window\.localGameAI\?\.start\(currentAccount\.id\)/);
|
||||
test('local AI is paused by default and adapter loading is gated by its feature flag', () => {
|
||||
assert.match(page, /const FEATURE_FLAGS = Object\.freeze\(\{localAI: false\}\)/);
|
||||
assert.match(page, /if \(!FEATURE_FLAGS\.localAI\) return Promise\.resolve\(null\)/);
|
||||
assert.match(page, /script\.src = '\/static\/' \+ 'wllama-gemma3-v2\/local-ai\.js'/);
|
||||
assert.doesNotMatch(page, /<script src="\/static\/wllama-gemma3-v2\/local-ai\.js"><\/script>/);
|
||||
assert.match(page, /if \(!currentAccount\.is_admin && FEATURE_FLAGS\.localAI\)[\s\S]*?loadLocalAiAdapter\(\)/);
|
||||
});
|
||||
|
||||
test('Gemma license links are shown in the accessible game dialogue and consent can be withdrawn', () => {
|
||||
|
||||
Reference in New Issue
Block a user