// Module: username

// Keys for session storage
const userNameKey = "username";
const testUserName = "test_user_not_specified"; // Set this to null if test name not wanted

function setUserName(name) {
    sessionStorage.setItem(userNameKey, name);
}

function getUserName() {
    const userName = sessionStorage.getItem(userNameKey);
    return (userName === null) ? testUserName : userName;
}

function resetUserName() {
    sessionStorage.removeItem(userNameKey);
}

export {setUserName, getUserName, resetUserName} ;