Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: consolidate wallet docs #1684

Conversation

petertonysmith94
Copy link
Contributor

relates: #1505

Changes made

  • Moved most wallet-based tests from fuel-gauge over docs-snippets.

Copy link
Contributor

@Torres-ssf Torres-ssf left a comment

Choose a reason for hiding this comment

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

@petertonysmith94 Thanks for helping us with this. We appreciate it 👍

@@ -152,196 +141,6 @@ describe('Doc Examples', () => {
expect(arrayify(assetId)).toEqual(arrayify(Address.fromB256(assetId).toB256()));
});

test('it can work with wallets', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

@petertonysmith94, we do want to move all code snippets to the doc-snippets directory when it is possible.

However, we cannot remove these e2e test cases from here, as they were most likely added for a specific reason.

When moving these code snippets, we need to write new, specific tests that validate only the required steps to ensure that the code snippet is working.

Therefore, in many cases, when migrating a code snippet, many test cases can be simplified.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @Torres-ssf, that all sounds reasonable!

I will reinstate the fuel-gauge package tests now.

In terms of test simplification, did you have any pointers/guidelines for this process?

From what is there now, I assume that will be generally keeping small, organised, with descriptive test file-name, and having single purpose. Happy to continue with this for now

Copy link
Contributor

@Torres-ssf Torres-ssf Feb 27, 2024

Choose a reason for hiding this comment

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

@petertonysmith94 The conventions that we use for code snippet tests are:

1 - Placing them inside apps/docs-snippets

2 - Naming the test file with the same name as the doc page.

3 - Design the test case based on what the code snippets are intended to show.

4- If the code snippet is from a Sway project, it needs to come from one of the projects within app/docs-snippets/test/fixtures/forc-projects/ or a new one created on the same dir.

For instance, on the Address section, this specific snippet was created to show how to instantiate a wallet from a public key.

@petertonysmith94
Copy link
Contributor Author

Closed in favour of #1885

@petertonysmith94 petertonysmith94 added the docs Requests pertinent to documentation label Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Requests pertinent to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants