mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-14 21:57:55 +08:00
6c7a162909
Summary: - Make sure user can log in using exchange - Adds some test helpers for the test - Updates eslint.json and cleans up lint errors Test Plan: - Integration Tests Reviewers: evan, bengotow Reviewed By: bengotow Differential Revision: https://phab.nylas.com/D2346
20 lines
459 B
JavaScript
20 lines
459 B
JavaScript
|
|
export const wait = (ms)=> {
|
|
return new Promise((resolve)=> {
|
|
setTimeout(()=> resolve(), ms);
|
|
});
|
|
};
|
|
|
|
export const clickRepeat = (client, selector, {times = 1, interval = 0} = {})=> {
|
|
if (times === 1) return client.click(selector);
|
|
const fn = (remaining)=> {
|
|
if (remaining > 0) {
|
|
return (
|
|
client.click(selector)
|
|
.then(()=> wait(interval))
|
|
.then(()=> fn(remaining - 1))
|
|
);
|
|
}
|
|
};
|
|
return fn(times);
|
|
};
|