feat: migrate platform login scenes and native login flows
This commit is contained in:
@@ -17,6 +17,19 @@ function legacy(raw: unknown, name: string, selected = identity) {
|
||||
GameData: { AgentId: selected.agentid, GameId: selected.gameid, ChannelId: selected.channelid, marketID: selected.marketid },
|
||||
});
|
||||
}
|
||||
|
||||
test('get_paravalue is the shared legacy-compatible reader, including an absent data wrapper', () => {
|
||||
assert.equal(typeof api.get_paravalue, 'function');
|
||||
const raw = {showVisitor:1,agentlist:[
|
||||
{agentid:11,showVisitor:0,gamelist:[{gameid:22,deviceLogin:true}]},
|
||||
{agentid:11,showVisitor:2},
|
||||
]};
|
||||
for(const name of ['showVisitor','deviceLogin','missing']) {
|
||||
assert.deepEqual(api.get_paravalue({data:raw},name,identity),legacy(raw,name));
|
||||
assert.deepEqual(view(raw).getValue(name),api.get_paravalue({data:raw},name,identity));
|
||||
}
|
||||
assert.equal(api.get_paravalue({},'showVisitor',identity),legacy(undefined,'showVisitor'));
|
||||
});
|
||||
test('memory view agrees with actual legacy function across all five scopes and preserves raw objects', () => {
|
||||
const scopes: Record<string, unknown>[] = [
|
||||
{ hall_config: { root: true }, rootOnly: 'root', falsy: 'inherited' },
|
||||
|
||||
Reference in New Issue
Block a user