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

Jest Tests List View #10

Open
LawrenceLoz opened this issue Nov 30, 2020 · 19 comments
Open

Jest Tests List View #10

LawrenceLoz opened this issue Nov 30, 2020 · 19 comments
Labels
enhancement New feature or request

Comments

@LawrenceLoz
Copy link
Owner

To create Jest tests to cover functionality of the components on the FormulaShare Rules list page:
formulaShareRulesPage
formulaShareRulesListView
formulaShareScheduleJobDescription
formulaShareNoRulesIllustration
formulaShareAbout

@sfdcschwabe
Copy link
Contributor

I would like to show you the first jest tests (not very complex of course) for formulaShareAbout but my VSC say 'You don't have permissions to push to 'LawrenceLoz/FormulaShare-DX' on GitHub. Would you like to create a fork and push to it instead?'

Are there some permissions missing for this repo?

@LawrenceLoz
Copy link
Owner Author

Sounds great, looking forwards to taking a look!

And yes if you're able to create a fork and branch there that would be great and I can take a look. Are you happy for us to follow this workflow? https://gist.github.com/Chaser324/ce0505fbed06b947d962

Thanks

@sfdcschwabe
Copy link
Contributor

I hope I've done it the right way. Take a look here: sfdcschwabe@c2b8caf
If there is anything more I could test let me know. Is it in your opinion necessary to test if there is a button present or a lightning-formatted-url with a specific link? Would you go that deep in the tests?

@LawrenceLoz
Copy link
Owner Author

This looks great, thanks for getting this together so quickly! I'm not an expert but I think the level you've done for this component is good given its simplicity. I don't think I'll have a chance to review in detail until early next week but I'll take a closer look then and try running myself and researching more into the best aspects to cover

@sfdcschwabe
Copy link
Contributor

No worries. I'm glad to help and gathering experiences in collaboration on GitHub with you on this project. Then I will move on further with testing the other components in more depth.
I also have to slow myself down a bit to not overwhelm you with messages. Please forgive me.

@LawrenceLoz
Copy link
Owner Author

Thanks and no problem, great to see your work so far and don't worry about going too quick, I'll catch up soon! Thanks a lot again for your contributions, it's looking great

@LawrenceLoz
Copy link
Owner Author

Hey Christian,

Just had a chance to get Jest set up, run your tests and take a look at your work in the branch so far.

In general it looks great - fantastic to see this all in place. If anything I'd suggest slightly less thorough HTML testing would be enough to ensure high level checks are made on the page of the most important elements, but that we don't check everything to reduce effort for simpler components and retain flexibility for page structure changes without significant test rewrites. Hopefully this will help you have more time for the more complicated aspects of components with more Javascript as well.

But think everything so far is great to keep, really happy this will be part of the project and big thanks again!

Lawrence

@sfdcschwabe
Copy link
Contributor

Hi Lawrence,

for any kind of reason I am not able to @mention you directly on a commit in my branch. See: sfdcschwabe@25f28d0#commitcomment-44895302

@LawrenceLoz
Copy link
Owner Author

Thanks I've just responded. Not sure what the issue is with @mentions - it might allow this now that I've commented in your repo

@sfdcschwabe
Copy link
Contributor

FYI - Added new tests: sfdcschwabe@ee37322

I'm not finished yet with the component formulaShareRulesListView.js, but want to share the current outcomes. Remember: These are my very fest written jest tests. I hope there are things to optimize. But for now: This level of experience is all I can give.

@LawrenceLoz
Copy link
Owner Author

Thanks Christian. I've had a look through and from my perspective looks really good so far (jest is new to me too but trying to keep up and use this as a chance to learn good practices as well). I've added a comment around the report tests but I can't see any improvements around other aspects - general all seems in keeping with the examples I've seen in the lwc-recipes repo

@sfdcschwabe
Copy link
Contributor

I can only mention you when you start commenting on a new commit after the first time.
Here is my comment: sfdcschwabe@6ecf9e2#commitcomment-45042111

@sfdcschwabe
Copy link
Contributor

@sfdcschwabe
Copy link
Contributor

Finally. The test coverage looks like the following:

----------------------------------------|---------|----------|---------|---------|-------------------------------------------------------------------------------

File % Stmts % Branch % Funcs % Lines Uncovered Line #s
All files 27.25 14.61 26.02 26.01
formulaShareAbout 100 100 100 100
formulaShareAbout.js 100 100 100 100
formulaShareNoRulesIllustration 50 100 0 50
formulaShareNoRulesIllustration.js 50 100 0 50 6-7
formulaShareRulesListView 75.16 54 63.33 74.15
formulaShareRulesListView.js 75.16 54 63.33 74.15 56-58,61-62,68,82,137-138,203,211-214,224-277,321,374-380,396-401,441-442,464
formulaShareRulesPage 100 100 100 100
formulaShareRulesPage.js 100 100 100 100
formulaShareScheduleJobDescription 75 100 50 66.67
formulaShareScheduleJobDescription.js 75 100 50 66.67 9
---------------------------------------- --------- ---------- --------- --------- -------------------------------------------------------------------------------

When we can clearify the following open questions regarding testing error handling and toast messages - we got it! :)
This is the most complex component in the bundle.

@LawrenceLoz
Copy link
Owner Author

Fantastic, this is looking really good! Hopefully the responses make sense and let me know if you want to check in on anything else

@sfdcschwabe
Copy link
Contributor

I've just wrote a reminder to the open questions where I didn't find an answer.

Looking forward: What could be the next issue or thing to work on? :)

@LawrenceLoz
Copy link
Owner Author

Given you've been looking at it quite a bit so far perhaps implementing a generic toast service and/or any alternative approach for presenting errors in a different way (happy for you to recommend and prototype an error panel approach if you think this gives a better look and feel)

Alternatively working on a component to be added to a record page to show sharing would be very useful, although this would be a longer term task. Let me know if you want to go this route and I'll create an issue with some detail around what would be needed.

You're honestly welcome to select whatever interests you the most though from things we've agreed would be beneficial, or if you'd like to propose something else that's fine too. It's your time so I think the most important thing is that it's something which you're enjoying working on or learning

@sfdcschwabe
Copy link
Contributor

I would feel safest to first revise the ToastMessages and implement my suggestion. Then I'm curious about your feedback.

About the other thing regarding the display of shares: What do you have in mind? You are welcome to create an issue for it. For me to introduce myself: Do you mean a display of shares like it already exists in Classic?

@LawrenceLoz
Copy link
Owner Author

All sounds good.

In terms of the page component, I think this would be a little like the sharing button in classic (which is finally coming to Lightning soon! https://help.salesforce.com/articleView?id=release-notes.rn_forcecom_manual_sharing_lex.htm&language=en_us&r=https%3A%2F%2Fwww.google.com%2F&release=230&type=5), but this would provide additional information and functionality which is tailored to FormulaShare sharing. It would be good to have a link to view the rule responsible for the sharing and/or show some context from the rule against the share. There could also be an option to recalculate sharing for the record, and maybe some other things. I'll get some thoughts together and pull together in an issue over the next few days.

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

No branches or pull requests

2 participants