Skip to content

Commit ac7980e

Browse files
committed
Testcase: change before hook to async
1 parent dd3d83e commit ac7980e

13 files changed

+26
-17
lines changed

test/search/autoscroll.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
describe('Autoscroll', function () {
22

3-
before(function(){
3+
before(function(done){
44
this.searchTest = fixture.load('mock/searchTestResponse.json');
55
//setup document to hold search results
66
document.body.innerHTML = __html__['index.html'];
@@ -14,6 +14,7 @@ describe('Autoscroll', function () {
1414

1515
//stub search ajax call with mock response
1616
this.stub = sinon.stub(jQuery, 'ajax').yieldsTo('success',this.searchTest);
17+
done();
1718
});
1819

1920
after(function(){

test/search/banner.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
describe('Banners', function () {
22

3-
before(function(){
3+
before(function(done){
44
this.bannerResponse = fixture.load('mock/bannerResponse.json');
55
//setup document to hold search results
66
document.body.innerHTML = __html__['index.html'];
@@ -11,7 +11,7 @@ describe('Banners', function () {
1111
//stub search ajax call with mock response
1212
this.stub = sinon.stub(jQuery, 'ajax')
1313
.yieldsTo('success',this.bannerResponse);
14-
14+
done();
1515
});
1616

1717
after(function(){

test/search/clickNscroll.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
describe('clickNScroll', function () {
22

3-
before(function(){
3+
before(function(done){
44

55
this.searchTest = fixture.load('mock/searchTestResponse.json');
66
//setup document to hold search results
@@ -17,7 +17,7 @@ describe('clickNScroll', function () {
1717
//stub search ajax call with mock response
1818
this.stub = sinon.stub(jQuery, 'ajax')
1919
.yieldsTo('success',this.searchTest);
20-
20+
done();
2121
});
2222

2323
after(function(){

test/search/facets.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
describe('Facets', function () {
22

3-
before(function(){
3+
before(function(done){
44
this.searchTest = fixture.load('mock/searchTestResponse.json');
55

66
//setup document to hold search results
@@ -19,7 +19,7 @@ describe('Facets', function () {
1919
.spy(this.searchobj.options, 'facetOnDeselect');
2020
this.spyRemoveFilter = sinon.spy(this.searchobj, 'removeFilter');
2121
this.spyClearFilters = sinon.spy(this.searchobj, 'clearFilters');
22-
22+
done();
2323
});
2424

2525
after(function(){

test/search/init.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
describe('On Init', function () {
22

3-
before(function(){
3+
before(function(done){
44
this.searchTest = fixture.load('mock/searchTestResponse.json');
55

66
//setup document to hold search results
@@ -20,6 +20,7 @@ describe('On Init', function () {
2020
this.spyOnNoResult = sinon.spy(this.searchobj.options, 'onNoResult');
2121

2222
this.searchobj.callResults(this.searchobj.paintResultSet);
23+
done();
2324
});
2425

2526
after(function(){

test/search/noResult.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
describe('No results', function () {
22

3-
before(function(){
3+
before(function(done){
44
this.zeroResultTest = fixture.load('mock/zeroResult.json');
55
//setup document to hold search results
66
document.body.innerHTML = __html__['index.html'];
@@ -16,6 +16,7 @@ describe('No results', function () {
1616
'onIntialResultLoad');
1717
this.spyOnNoResult = sinon.spy(this.searchobj.options,'onNoResult');
1818
this.searchobj.callResults(this.searchobj.paintResultSet);
19+
done();
1920
});
2021

2122
after(function(){

test/search/pageSize.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
describe('PageSize', function () {
22

3-
before(function(){
3+
before(function(done){
44
this.searchTest = fixture.load('mock/searchTestResponse.json');
55
//setup document to hold search results
66
document.body.innerHTML = __html__['index.html'];
@@ -13,6 +13,7 @@ describe('PageSize', function () {
1313

1414
//stub search ajax call with mock response
1515
this.stub = sinon.stub(jQuery, 'ajax').yieldsTo('success',this.searchTest);
16+
done();
1617
});
1718

1819
after(function(){

test/search/pagination.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
describe('Pagination', function () {
22

3-
before(function(){
3+
before(function(done){
44
this.searchTest = fixture.load('mock/searchTestResponse.json');
55

66
//setup document to hold search results
@@ -19,6 +19,7 @@ describe('Pagination', function () {
1919
this.spyOnIntialResultLoad = sinon.spy(this.searchobj.options,
2020
'onIntialResultLoad');
2121
this.spyOnPageLoad = sinon.spy(this.searchobj.options, 'onPageLoad');
22+
done();
2223
});
2324

2425
after(function(){

test/search/redirect.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
describe('Redirect', function () {
22

3-
before(function(){
3+
before(function(done){
44
this.RedirectTest = fixture.load('mock/redirect.json');
55
//setup document to hold search results
66
document.body.innerHTML = __html__['index.html'];
@@ -22,6 +22,7 @@ describe('Redirect', function () {
2222
.returns(false);
2323

2424
this.searchobj.callResults(this.searchobj.paintResultSet);
25+
done();
2526
});
2627

2728
after(function(){

test/search/sort.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
describe('Sort', function () {
22

3-
before(function(){
3+
before(function(done){
44
this.searchTest = fixture.load('mock/searchTestResponse.json');
55

66
//setup document to hold search results
@@ -12,6 +12,7 @@ describe('Sort', function () {
1212
//stub search ajax call with mock response
1313
this.stub = sinon.stub(jQuery, 'ajax').yieldsTo('success',this.searchTest);
1414
this.spyAddSort = sinon.spy(this.searchobj,'addSort');
15+
done();
1516
});
1617

1718
after(function(){

0 commit comments

Comments
 (0)