Skip to content

Commit

Permalink
Removed async from attribute test
Browse files Browse the repository at this point in the history
  • Loading branch information
Snugug committed Dec 30, 2014
1 parent f0e6f13 commit 7d90548
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions tests/attribute.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
describe('Set the `data-eq-state` attribute based on element width', function () {
var elem = document.createElement('div'),
body = document.querySelector('body'),
async = new AsyncSpec(this),
sizes = [],
result;

Expand Down Expand Up @@ -32,82 +31,75 @@ describe('Set the `data-eq-state` attribute based on element width', function ()
//////////////////////////////
// No Sizes
//////////////////////////////
async.it('should have no state if its width is smaller than smallest size', function (done) {
it('should have no state if its width is smaller than smallest size', function () {
body.style.width = (sizes[0] - 1) + 'px';
eqjs.refreshNodes();
eqjs.query(undefined, function () {
result = elem.getAttribute('data-eq-state');
expect(result).toBe(null);
done();
});
});

//////////////////////////////
// Small Sizes
//////////////////////////////
async.it('should be `small` when its width is equal to its smallest size', function (done) {
it('should be `small` when its width is equal to its smallest size', function () {
body.style.width = (sizes[0]) + 'px';
eqjs.refreshNodes();
eqjs.query(undefined, function () {
result = elem.getAttribute('data-eq-state');
expect(result).toBe('small');
done();
});
});

async.it('should be `small` when its width is larger to its smallest size but smaller than its `medium` size', function (done) {
it('should be `small` when its width is larger to its smallest size but smaller than its `medium` size', function () {
body.style.width = (sizes[0] + 1) + 'px';
eqjs.refreshNodes();
eqjs.query(undefined, function () {
result = elem.getAttribute('data-eq-state');
expect(result).toBe('small');
done();
});
});

//////////////////////////////
// Medium Sizes
//////////////////////////////
async.it('should be `medium` when its width is equal to its smallest size', function (done) {
it('should be `medium` when its width is equal to its smallest size', function () {
body.style.width = (sizes[1]) + 'px';
eqjs.refreshNodes();
eqjs.query(undefined, function () {
result = elem.getAttribute('data-eq-state');
expect(result).toBe('medium');
done();
});
});

async.it('should be `medium` when its width is larger to its medium size but smaller than its `larger` size', function (done) {
it('should be `medium` when its width is larger to its medium size but smaller than its `larger` size', function () {
body.style.width = (sizes[1] + 1) + 'px';
eqjs.refreshNodes();
eqjs.query(undefined, function () {
result = elem.getAttribute('data-eq-state');
expect(result).toBe('medium');
done();
});
});

//////////////////////////////
// Large Sizes
//////////////////////////////
async.it('should be `large` when its width is equal to its largest size', function (done) {
it('should be `large` when its width is equal to its largest size', function () {
body.style.width = (sizes[2]) + 'px';
eqjs.refreshNodes();
eqjs.query(undefined, function () {
result = elem.getAttribute('data-eq-state');
expect(result).toBe('large');
done();
});
});

async.it('should be `large` when its width is larger to its largest size', function (done) {
it('should be `large` when its width is larger to its largest size', function () {
body.style.width = (sizes[2] + 1) + 'px';
eqjs.refreshNodes();
eqjs.query(undefined, function () {
result = elem.getAttribute('data-eq-state');
expect(result).toBe('large');
done();
});
});
});

0 comments on commit 7d90548

Please sign in to comment.