feat: CI regression: packaged mobile first-task coach remains hidden #1273
|
|
@ -62,7 +62,10 @@
|
|||
|
||||
function renderCoach() {
|
||||
if (!options.coach) return;
|
||||
options.coach.hidden = !(options.mediaQuery.matches && state() === 'coaching' && options.isTodayActive());
|
||||
const visible = options.mediaQuery.matches && state() === 'coaching' && options.isTodayActive();
|
||||
options.coach.hidden = !visible;
|
||||
const host = options.coach.closest?.('[data-mobile-today-hud]');
|
||||
if (visible && host) host.hidden = false;
|
||||
}
|
||||
|
||||
function render() {
|
||||
|
|
|
|||
|
|
@ -190,6 +190,26 @@ process.stdout.write(JSON.stringify({offline, calls, sheetOpen:sheet.open}));
|
|||
}
|
||||
|
||||
|
||||
def test_first_task_coaching_reveals_its_mobile_today_host():
|
||||
result = run_node(
|
||||
"""
|
||||
const values = new Map([['stackchain.first-task.v1:timmy', 'coaching']]);
|
||||
const host = new Element(); host.hidden = true;
|
||||
const coach = new Element(); coach.hidden = true; coach.closest = () => host;
|
||||
const controller = createFirstTask({
|
||||
storage:{getItem:key=>values.get(key)||null,setItem:(key,value)=>values.set(key,value)},
|
||||
getLogin:()=> 'timmy',hasWork:()=>true,isTodayActive:()=>true,isOnline:()=>true,
|
||||
mediaQuery:{matches:true},sheet:new Element(),title:new Element(),coach,receipt:new Element(),
|
||||
findButton:new Element(),createButton:new Element(),setupButton:new Element(),closeButton:new Element(),status:new Element(),
|
||||
});
|
||||
controller.refresh();
|
||||
process.stdout.write(JSON.stringify({coachHidden:coach.hidden,hostHidden:host.hidden}));
|
||||
"""
|
||||
)
|
||||
|
||||
assert result == {"coachHidden": False, "hostHidden": False}
|
||||
|
||||
|
||||
def test_first_task_exposes_completion_operation_before_showing_local_success():
|
||||
result = run_node(
|
||||
"""
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user