From d811cf3c41af2e8a845dc99aa425952da996b40f Mon Sep 17 00:00:00 2001 From: Timeo Williams Date: Sat, 28 Sep 2024 12:33:44 -0400 Subject: [PATCH] fix: title test in playwright tests --- electron-builder.yml | 2 +- package.json | 4 ++-- scripts/deleteUserData.js | 2 +- tests/e2e/userflow.spec.ts | 47 -------------------------------------- 4 files changed, 4 insertions(+), 51 deletions(-) diff --git a/electron-builder.yml b/electron-builder.yml index 6621ad5..f18abda 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -28,7 +28,7 @@ mac: dmg: artifactName: ${name}-${version}.${ext} win: - executableName: deepfocus + executableName: Deep Focus nsis: artifactName: ${name}-${version}-setup.${ext} shortcutName: ${productName} diff --git a/package.json b/package.json index f004a04..0da7f45 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "deepfocus", - "version": "1.1.0", + "name": "deepFocus", + "version": "1.2.0", "description": "DeepFocus is a productivity tool that helps you stay focused and productive by tracking your time spent on your computer.", "main": "./out/main/main.js", "author": "Timeo Williams", diff --git a/scripts/deleteUserData.js b/scripts/deleteUserData.js index 5c803c4..188abfb 100644 --- a/scripts/deleteUserData.js +++ b/scripts/deleteUserData.js @@ -2,7 +2,7 @@ import path from 'path' import fs from 'fs' import os from 'os' -const appName = 'deepfocus' // Replace with your actual app name +const appName = 'Deep Focus' // Replace with your actual app name const appDataPath = path.join(os.homedir(), 'Library', 'Application Support', appName) console.log(appDataPath) // /Users/timeo/Library/Application Support/deepfocus diff --git a/tests/e2e/userflow.spec.ts b/tests/e2e/userflow.spec.ts index d088113..3bad740 100644 --- a/tests/e2e/userflow.spec.ts +++ b/tests/e2e/userflow.spec.ts @@ -54,52 +54,5 @@ test.describe('Electron App', () => { // Ensure the Electron app loads correctly const title = await window.title() expect(title).toBe('deepFocus') - - await window.waitForSelector('span') - const text = await window.$eval('span', (el) => el.textContent) - expect(text).toBe('deep') }) }) - -/* - test('should handle user login', async () => { - // Interact with the login form - await window.title() - await window.click('xpath=/html/body/div/header/nav/a[2]', { delay: 1500 }) - await window.click('input[name="email"]') - await window.fill('input[name="email"]', 'timeo.j.williams@gmail.com', { force: true }) - await window.click('input[name="password"]') - await window.fill('input[name="password"]', 'test', { force: true }) - await window.click('button:has-text("Login")') - - // Validate login success by checking the URL - const currentURL = window.url() - expect(currentURL).toBe('http://localhost:5173/') // Adjust the expected URL as needed - }) - - // test('should send data via IPC', async () => { - - // // Simulate sending data from the renderer process to the main process - // await window.evaluate(() => { - // const user = { - // username: 'timeo.j.williams@gmail.com', - // language: 'English', - // country: 'USA', - // firstName: 'Timeo', - // lastName: 'Williams' - // } - // window.sendUserData(user) // Use the exposed API from the preload script - // }) - - // // Simulate listening on the main process for the IPC event - // const userData: User = await electronApp.evaluate(({ ipcMain }) => { - // return new Promise((resolve) => { - // ipcMain.on('send-user-data', (_, data) => resolve(data)) - // }) - // }) - - // expect(userData.username).toBe('timeo.j.williams@gmail.com') - - // }) - - */