-
Notifications
You must be signed in to change notification settings - Fork 45
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
[Work in Progress] Testing Suite #107
Conversation
Status Update.
|
src/freeze-dry/fix-links.test.js
Outdated
import fixLinks from 'src/freeze-dry/fix-links' | ||
|
||
describe('fixLinks tests', () => { | ||
test('should append a base with the href of doc', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is failing because of the change made by Gerben at Commit
I am actually a bit confused on the implementation of the following modules and any help will be greatly appreciated. This will help finish off the utils and the page-analysis module. To be clear, I am not sure how I can test these modules.
|
@reficul31: ok, good that you ask about it, I added a bit of documentation to those three utils to clarify their workings. Not perfect still. Ask if something specific is unclear, and feel free to suggest more/better documentation (especially the larger things in |
@Treora Thanks for updating the documentation for the functions in the util module. I actually wanted to know how to approach testing the functions in the module. Would there be some specific functionality you wanted to be tested for in those module? |
This is a summary of all the problems I have been facing for quite a few days now. Issue with the render method of src/options/components/navigationThere seems to be a very weird error that keeps recurring in the render method of the Navigation component in the options module. I know it is a problem with the tag, but I can't seem to figure out why. I have updated all my packages(repeatedly), scoured the world if weird react doubts, but nothing seem to be working. I know it is something extremely trivial but I can't seem to put my finger on it. To check out the failing test Test Can't seem to figure out how to test these moudlesI already mentioned this before, but I can't seem to figure out a good testing method to test the following components. Any help will be extremely appreciated. Just to be clear I know what the modules are being used for I just want to know how should I go about testing them.
Progress Report For in depth progress report. Please refer to the blog. |
Thanks for reporting the progress, and sorry to leave you hanging with some problems. Have you discussed them with your GSoC mentors? (as for the options page, I would not bother about it now, since we don't even have any options yet! I thought to just remove it from the code base for the moment) I am now working hard on getting a release out, and hacking proof-of-concepts to demo and explore subsequent features. I plan to have a break from that effort next week, and reserve a few days to clean up, document and reorganise code (#112), which would be a good moment to add some tests! Perhaps we could find some time then to code together over chat or call? |
Sure thing! Dm me whenever you find the time to talk. I know the release date is coming fast, thanks for taking the effort to reply to my queries. I know you must be swamped. As for the options module it's up to you to leave it in. I have written some tests which I think act as great placeholders for system tests for when the module is ready. The query was one of concept.
This is the agreed upon place of discussion with my mentors where I can communicate with them easily. |
I have debugged the issue. @reficul31 You need to downgrade react-router in package.json to How have I debugged and found the problem(Might be interesting to learn from for future errors)
|
Response to: Can't seem to figure out how to test these moudles
If you still have trouble testing anything after reading the suggestions, let me know. I didn't write down every detail. Suggestions for testingsrc/page-analysis/background/index
src/page-analysis/content_script/extract-pdf-content
src/util/event-to-promise
src/util/sync-location-hash
function createWindowStub({hash}) {
return {
location: {hash},
addEventListener: jest.fn(),
removeEventListener: jest.fn()
}
} src/util/tab-eventsIf we want to unit test those functions, I would mock the browser.tabs API. src/util/webextensionRPC
src/util/when-all-settled
|
So I have been writing some React tests using enzyme, and I was wondering to get some help regarding what all functionality is to be tested for.
I would really like to know more things I could test for in the components. |
Refs
NOTE: Do not merge. Work in progress for the testing suite built with jest.
Status