Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Add Unit Testing to SplitImage #191

Closed
smcgregor opened this issue Mar 4, 2015 · 3 comments
Closed

Add Unit Testing to SplitImage #191

smcgregor opened this issue Mar 4, 2015 · 3 comments

Comments

@smcgregor
Copy link
Member

The existing proof-of-concept for SplitImage does not have unit tests. We should add them.

See also #160 #189 #190

@vatsalj
Copy link
Contributor

vatsalj commented Mar 12, 2015

@smcgregor Hi! I was travelling so could not put in another pull request. I remember your comments on the last PR and I would like to clarify a bit about writing the unit test.
The docs say that ideally, we should create fixtures, otherwise, elements can be created inside the JS itself. So, I would like to ask if in this case, fixture is just an HTML file (or a generic HTML code kept inside some common JS file) which I can create and load using loadFixtures? If not that, can you please help me understand what a fixture can be in this case? However, if you recommend not using fixtures at this moment, should I simply create the elements required in the JS itself as follows:

var home_dom = document.createElement('a');
home_dom.addClass("home_domain");
document.body.appendChild(home_dom);

and initialize them using proper initialization functions (such as privlyNetworkService.initializeNavigation)?
Please let me know which approach should I take. Or if I'm missing something I request you to give me some more guidance. Thanks!

@smcgregor
Copy link
Member Author

Both processes you are describing are creating fixtures. Fixtures are an expression of the pre-conditions, not a specific filetype. We may eventually start defining fixtures in a collection like on Rails (and others), but for now your manual method of creating elements is sufficient.

...a test fixture is all the things that must be in place in order to run a test and expect a particular outcome.
Frequently fixtures are created by handling setUp() and tearDown() events of the unit testing framework. In setUp() one would create the expected state for the test, and in tearDown() it would clean up what had been set up.

vatsalj added a commit to vatsalj/privly-applications that referenced this issue Mar 12, 2015
vatsalj added a commit to vatsalj/privly-applications that referenced this issue Mar 12, 2015
smcgregor added a commit that referenced this issue Mar 28, 2015
Issue #191: Unit tests for SplitImage.
@smcgregor
Copy link
Member Author

SplitImage has useful code for those looking to implement an image encryption app on top of Privly, but the architecture has some major changes introduced in the gsoc-development branch. It would be better to start over from that branch's Message application.

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

No branches or pull requests

2 participants