Created
September 3, 2023 18:04
-
-
Save YonatanKra/732ab9ffbbfc50da6bb6d887d9a24240 to your computer and use it in GitHub Desktop.
Tauri-demo refactored first test
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
it('should set the greeting message inside the message element', async () => { | |
setupDomElements(); | |
window.dispatchEvent(new Event("DOMContentLoaded")); | |
const name = 'John Doe'; | |
const { greetForm, greetMsgEl } = getElementsAndSetInputValue(name); | |
mockIPC((cmd, args) => { | |
if(cmd === "greet") { | |
return `Hello, ${args.name}! You've been greeted from Rust!`; | |
} | |
}); | |
await dispatchFormSubmit(greetForm); | |
expect(greetMsgEl?.textContent).toBe(`Hello, ${name}! You've been greeted from Rust!`); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment