Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
solr-frontend
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
1cbd9db0
authored
2016-11-08 12:17:21 -0600
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Fix test cases when the singleton facet instance change was previously
implemented.
1 parent
65fd1e2a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
2 deletions
src/scripts/solr/model/Facet.spec.js
src/scripts/solr/model/Facets.spec.js
src/scripts/solr/model/Solr.spec.data.js
src/scripts/solr/model/Facet.spec.js
View file @
1cbd9db
...
...
@@ -225,7 +225,7 @@ define(function(require) {
var
f
;
beforeEach
(
function
()
{
if
(
typeof
builder
.
nameOrBuilder
===
'string'
)
{
f
=
SolrSpecData
.
facets
Builder
(
builder
.
nameOrBuilder
);
f
=
SolrSpecData
.
facets
Instance
(
builder
.
nameOrBuilder
);
}
else
{
f
=
builder
.
nameOrBuilder
();
}
...
...
src/scripts/solr/model/Facets.spec.js
View file @
1cbd9db
...
...
@@ -24,7 +24,7 @@ define(function(require) {
_
.
now
=
function
()
{
return
new
Date
().
getTime
();
};
spyOn
(
Backbone
,
'ajax'
);
onItemChange
=
jasmine
.
createSpy
(
'onItemChange'
);
f
=
new
Facets
(
SolrSpecData
.
facets
Builder
(),
{
search
:
{
url
:
'/'
}});
f
=
new
Facets
(
SolrSpecData
.
facets
Instance
(),
{
search
:
{
url
:
'/'
}});
f
.
on
(
'item-change'
,
onItemChange
);
});
afterEach
(
function
()
{
...
...
src/scripts/solr/model/Solr.spec.data.js
View file @
1cbd9db
...
...
@@ -357,6 +357,17 @@ define(function(require) {
function
facetsBuilder
(
wantedFacetName
)
{
if
(
wantedFacetName
)
{
return
{
data
:
definedFacets
[
wantedFacetName
].
facetData
,
options
:
definedFacets
[
wantedFacetName
].
facetOptions
};
}
var
result
=
{};
_
.
each
(
_
.
keys
(
definedFacets
),
function
(
facetName
)
{
result
[
facetName
]
=
{
data
:
definedFacets
[
facetName
].
facetData
,
options
:
definedFacets
[
facetName
].
facetOptions
};
});
return
result
;
}
function
facetsInstance
(
wantedFacetName
)
{
if
(
wantedFacetName
)
{
return
new
Facet
(
definedFacets
[
wantedFacetName
].
facetData
,
definedFacets
[
wantedFacetName
].
facetOptions
);
}
var
result
=
{};
...
...
@@ -440,6 +451,7 @@ define(function(require) {
testSearchBuilder
:
testSearchBuilder
,
expectItem
:
expectItem
,
facetsBuilder
:
facetsBuilder
,
facetsInstance
:
facetsInstance
,
responses
:
responses
,
extractFacetData
:
extractFacetData
,
};
...
...
Please
register
or
sign in
to post a comment