forked from frappe/books
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- fix auto complete choice on blur - fix button disabled
- Loading branch information
Showing
6 changed files
with
46 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
.DS_Store | ||
node_modules | ||
/dbs | ||
/dist | ||
/notebook | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
" | ||
> | ||
<h6 | ||
data-testid="company-name" | ||
class=" | ||
font-semibold | ||
whitespace-nowrap | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ const appSourcePath = path.join(root, 'dist_electron', 'build', 'main.js'); | |
(async function run() { | ||
const electronApp = await _electron.launch({ args: [appSourcePath] }); | ||
const window = await electronApp.firstWindow(); | ||
window.setDefaultTimeout(10_000); | ||
|
||
test('load app', async (t) => { | ||
t.equal(await window.title(), 'Frappe Books', 'title matches'); | ||
|
@@ -42,9 +43,43 @@ const appSourcePath = path.join(root, 'dist_electron', 'build', 'main.js'); | |
t.ok(await createNew.isVisible(), 'create new is visible'); | ||
}); | ||
|
||
test('fill setup form', async (t) => { | ||
const filePath = path.join(root, 'dbs', 'books_uitest.db'); | ||
await electronApp.evaluate(({ dialog }, filePath) => { | ||
dialog.showSaveDialog = () => | ||
Promise.resolve({ canceled: false, filePath }); | ||
}, filePath); | ||
await window.getByTestId('create-new-file').click(); | ||
await window.getByTestId('submit-button').waitFor(); | ||
|
||
t.equal( | ||
await window.getByTestId('submit-button').isDisabled(), | ||
true, | ||
'submit button is disabled before form fill' | ||
); | ||
|
||
await window.getByPlaceholder('Company Name').fill('Test Company'); | ||
await window.getByPlaceholder('John Doe').fill('Test Owner'); | ||
await window.getByPlaceholder('[email protected]').fill('[email protected]'); | ||
await window.getByPlaceholder('Select Country').fill('India'); | ||
await window.getByPlaceholder('Select Country').blur(); | ||
await window.getByPlaceholder('Prime Bank').fill('Test Bank'); | ||
await window.getByPlaceholder('Prime Bank').blur(); | ||
|
||
t.equal( | ||
await window.getByTestId('submit-button').isDisabled(), | ||
false, | ||
'submit button enabled after form fill' | ||
); | ||
}); | ||
|
||
test('create new instance', async (t) => { | ||
// await window.getByTestId('create-new-file').click(); | ||
t.ok(true, '...'); | ||
await window.getByTestId('submit-button').click(); | ||
t.equal( | ||
await window.getByTestId('company-name').innerText(), | ||
'Test Company', | ||
'new instance created, company name found in sidebar' | ||
); | ||
}); | ||
|
||
test('close app', async (t) => { | ||
|