diff --git a/e2e-tests/common.js b/e2e-tests/common.js index 0f2d1afb5..52c2c3e41 100644 --- a/e2e-tests/common.js +++ b/e2e-tests/common.js @@ -1,6 +1,6 @@ -export const checkLogInOrNot = async(window, expect) => { +export const checkLogInOrNot = async (window, expect) => { await window.waitForSelector('//*[@id="__next"]/div', '//*[@id="__next"]/div[1]') - const textVisble = await window.locator('//h1["@aria-label=projects"]', {timeout:3000}).isVisible() + const textVisble = await window.locator('//h1["@aria-label=projects"]', { timeout: 3000 }).isVisible() if (textVisble) { const title = await window.textContent('[aria-label=projects]') await expect(title).toBe('Projects') @@ -15,12 +15,12 @@ export const checkLogInOrNot = async(window, expect) => { export const filterUser = (json, name) => { const filtered = json.filter((user) => - user.username.toLowerCase() !== name.toLowerCase() - ) - return filtered - } + user.username.toLowerCase() !== name.toLowerCase() + ) + return filtered +} -export const userJson = async(window, packageInfo, fs, path) => { +export const userJson = async (window, packageInfo, fs, path) => { const newpath = await window.evaluate(() => Object.assign({}, window.localStorage)) const file = path.join(newpath.userPath, packageInfo.name, 'users', 'users.json'); const data = await fs.readFileSync(file); @@ -40,8 +40,8 @@ export const userFile = async (window, packageInfo, path) => { export const removeFolderAndFile = async (fs, folder, userName, json, file) => { fs.rmSync(folder, { recursive: true, force: true }) const filtered = json.filter((item) => - item.username.toLowerCase() !== userName.toLowerCase() -) + item.username.toLowerCase() !== userName.toLowerCase() + ) return await fs.writeFileSync(file, JSON.stringify(filtered)) }