jfirebaugh / konacha

Test your Rails application's JavaScript with the mocha test framework and chai assertion library
Other
1.05k stars 117 forks source link

Grep Path incorrect. #229

Open kaukas opened 8 years ago

kaukas commented 8 years ago

Hello.

Thank you for the very useful testing framework! I am relying on it to test some complex frontend code.

I have one issue with the links to suites. To the right of every test Mocha displays a link to a page that runs just that test (a triangle within a circle). The URL is incorrect though. E.g. if I run the /models tests and then want to test a Book model it will link to /models/book_spec/models/?grep=Book. Instead it should be /models/book_spec/?grep=Book. I think it has to do with the grepString variable in konacha/parent.js file. Besides storing the ?grep=Book part it also has the current path: /models/?grep=Book. This part needs to be filtered out. Adding

grepString = grepString.substr(grepString.indexOf('?'));

fixes the problem for me.

Am I the only one with this problem? If not should I make a PR?

Thank you!

kaukas commented 8 years ago

The fix does not work on IE8. I will look for a solution and comment again.