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

Cross referencing user feedback and tests #78

Merged
merged 1 commit into from
Jun 8, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions test/spec/common/tag-cloud-spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@

/**
<pre>
======== A Handy Little Jasmine Reference ========
https://github.com/pivotal/jasmine/wiki/Matchers

Spec matchers:
expect(x).toEqual(y); compares objects or primitives x and y and passes if they are equivalent
expect(x).toBe(y); compares objects or primitives x and y and passes if they are the same object
expect(x).toMatch(pattern); compares x to string or regular expression pattern and passes if they match
expect(x).toBeDefined(); passes if x is not undefined
expect(x).toBeUndefined(); passes if x is undefined
expect(x).toBeNull(); passes if x is null
expect(x).toBeTruthy(); passes if x evaluates to true
expect(x).toBeFalsy(); passes if x evaluates to false
expect(x).toContain(y); passes if array or string x contains y
expect(x).toBeLessThan(y); passes if x is less than y
expect(x).toBeGreaterThan(y); passes if x is greater than y
expect(function(){fn();}).toThrow(e); passes if function fn throws exception e when executed

Every matcher's criteria can be inverted by prepending .not:
expect(x).not.toEqual(y); compares objects or primitives x and y and passes if they are not equivalent

Custom matchers help to document the intent of your specs, and can help to remove code duplication in your specs.
beforeEach(function() {
this.addMatchers({

toBeLessThan: function(expected) {
var actual = this.actual;
var notText = this.isNot ? " not" : "";

this.message = function () {
return "Expected " + actual + notText + " to be less than " + expected;
}

return actual < expected;
}

});
});
</pre>

* @requires FieldDB
* @requires Jasmine
*
* @example FieldDB
* @module FieldDBTest
* @extends Jasmine.spec
*/
describe("tagcloud", function() {

it("should automatically detect if a user is making a tag cloud #66", function() {
expect(true).toBeTruthy();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vronvali for #68 you can modify this test to have 4-ish tests like this one, for each user type you found in #76

});

it("should allow all the words typed to go into the cloud #66", function() {
expect(true).toBeTruthy();
});

it("should duplicate to fill space #66 ", function() {
expect(true).toBeTruthy();
});
it("It should work with Japanese #72 ", function() {
expect(true).toBeTruthy();
});
it("Should work on Chromebooks #73", function() {
expect(true).toBeTruthy();
});
it("Should be able to move the words around #63", function() {
expect(true).toBeTruthy();
});
it("Should be a kid friendly mode #69", function() {
expect(true).toBeTruthy();
});


});
6 changes: 3 additions & 3 deletions test/spec/common/wordcloud-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ describe('lib/word-cloud', function() {
expect(true).toBeTruthy();
});

it('should generate svgs for import into Inkscape/Illustrator', function() {
it('should generate svgs for import into Inkscape/Illustrator #70', function() {
expect(true).toBeTruthy();
});

it('should generate pngs for fast sharing/re-use', function() {
it('should generate pngs for fast sharing/re-use #70', function() {
expect(true).toBeTruthy();
});

Expand All @@ -156,7 +156,7 @@ describe('lib/word-cloud', function() {
expect(true).toBeTruthy();
});

it('should render within a custom svg outline/shape', function() {
it('should render within a custom svg outline/shape #67', function() {
expect(true).toBeTruthy();
});

Expand Down