applait / finderjs

Finder and file picker library for Firefox OS
http://finder.js.org
MIT License
14 stars 7 forks source link

Write tests for checkhidden method #4

Closed kaustavdm closed 9 years ago

kaustavdm commented 9 years ago

Write a separate spec for checkhidden method.

It should test if checkhidden:

Put these tests in a new specfile at tests/methodSpec.js.

kaustavdm commented 9 years ago

@jaipradeesh There is now a file called tests/methodSpec.js resulting from #8. Please pull the latest master into your branch or else you will hit merge conflicts.

Also, it may be easier to just add your bunch of tests to the current methodSpec.js.

dolftax commented 9 years ago
var finder = new Applait.Finder();
finder.hidden = false;
var checkhidden = finder.checkhidden("/sdcard/DCIM/100MZLLA/1.jpg");

expect(checkhidden).toBe(false);

@kaustavdm This test always fails. It should return false when this.hidden is false , right?

kaustavdm commented 9 years ago

@jaipradeesh you need to pass them in the constructor options. Adding a setAttribute method is one of the feature implementations I have in mind. But for now, you need to do this:

var finder = new Applait.Finder({ hidden: true });