Skip to content

Conversation

jiafuei
Copy link

@jiafuei jiafuei commented May 11, 2022

Add e2e testing for example app

@jiafuei jiafuei requested review from ieow and metallicalfa2 May 11, 2022 05:14
@@ -1,39 +1,13987 @@
{
"name": "vue-app",
"version": "0.1.0",
"lockfileVersion": 1,
"lockfileVersion": 2,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we commit package lock files for test commits? cc: @metallicalfa2

Comment on lines +52 to +62
const [page1] = await Promise.all([
page.waitForEvent("popup"),
page.click("button >> text=Sign All Transactions")
]);

await page1.waitForSelector("text=Confirm Permission");
await page1.click("button >> text=Approve")
await wait(1500);

const consoleData = JSON.parse(await page.locator("#console > p").innerText());
expect(consoleData).toHaveLength(3);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use try, catch to test error sceneraio's console to have better coverage?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you clarify how try catch will increase test coverage here?

jiafuei added 4 commits June 2, 2022 23:35
# Conflicts:
#	examples/vue-app/package-lock.json
#	examples/vue-app/package.json
#	examples/vue-app/src/components/HelloWorld.vue
#	package-lock.json
Copy link
Contributor

@guru-web3 guru-web3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good cc @metallicalfa2

please confirm if this is okay to show in example app
<button @click="() => transfer(10001)">Transfer error
<button @click="() => lookupDepositSPL(mintAddress, 100)" :disabled="network!==testnet">Custom program error (Testnet)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants