9a91324456
* - mock detect when user turns into moderator - add moderator indicator to display on messages and username changer * also mock moderator flag in message payload about user to display indicator * add some menu looking icons and a menu of actions * WIP chat moderators * Add support for admin promoting a user to moderator * WIP- open a more info panel of user+message info; add some a11y to buttons * style the details panel * adjust positioning of menus * Merge fixes. ChatClient->Client ChatServer->Server * Remove moderator bool placeholders to use real state * Support inline hiding of messages by moderators * Support inline banning of chat users * Cleanup linter warnings * Puppeteer tests fail after typing take place * Manually resolve conflicts in chat between moderator feature and develop Co-authored-by: Gabe Kangas <gabek@real-ity.com>
53 lines
1.6 KiB
JavaScript
53 lines
1.6 KiB
JavaScript
async function interactiveChatTest(
|
|
browser,
|
|
page,
|
|
newName,
|
|
chatMessage,
|
|
device
|
|
) {
|
|
it('should have the chat input', async () => {
|
|
await page.waitForSelector('#message-input');
|
|
});
|
|
|
|
it('should have the chat input enabled', async () => {
|
|
const isDisabled = await page.evaluate(
|
|
'document.querySelector("#message-input").getAttribute("disabled")'
|
|
);
|
|
expect(isDisabled).not.toBe('true');
|
|
});
|
|
|
|
it('should have the username label', async () => {
|
|
await page.waitForSelector('#username-display');
|
|
});
|
|
|
|
it('should allow changing the username on ' + device, async () => {
|
|
await page.waitForSelector('#username-display');
|
|
await page.evaluate(() =>
|
|
document.querySelector('#username-display').click()
|
|
);
|
|
await page.waitForSelector('#username-change-input');
|
|
await page.evaluate(() =>
|
|
document.querySelector('#username-change-input').click()
|
|
);
|
|
await page.evaluate(() =>
|
|
document.querySelector('#username-change-input').click()
|
|
);
|
|
await page.waitForSelector('#button-update-username');
|
|
|
|
await page.evaluate(() =>
|
|
document.querySelector('#button-update-username').click()
|
|
);
|
|
});
|
|
|
|
it('should allow typing a chat message', async () => {
|
|
await page.waitForSelector('#message-input');
|
|
await page.evaluate(() => document.querySelector('#message-input').click());
|
|
await page.waitForTimeout(1000);
|
|
await page.focus('#message-input');
|
|
await page.keyboard.type(chatMessage);
|
|
page.keyboard.press('Enter');
|
|
});
|
|
}
|
|
|
|
module.exports.interactiveChatTest = interactiveChatTest;
|