* wip
This commit is contained in:
parent
63369475a3
commit
537e4d3de4
|
|
@ -13,11 +13,9 @@ class JamTrackUtils
|
|||
|
||||
# check if the shopping cart should be shown
|
||||
checkShoppingCart: () =>
|
||||
@logger.debug("CHECK SHOPPING CART")
|
||||
@rest.getShoppingCarts().done(this.displayCartIcon)
|
||||
|
||||
displayCartIcon: (carts) =>
|
||||
@logger.debug("DONE CHECKING SHOPPING CART")
|
||||
cartLink = $("#header-shopping-cart")
|
||||
if carts.length > 0
|
||||
cartLink.removeClass("hidden")
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ MIX_MODES = context.JK.MIX_MODES
|
|||
value={searchValue}
|
||||
onChange={this.onSelectChange}
|
||||
onBlur={this.onSelectBlur}
|
||||
onFocus={this.onSelectFocus}
|
||||
className="autocompleter"
|
||||
cacheAsyncResults={false}
|
||||
filterOption={this.filterOption}
|
||||
|
|
@ -64,6 +65,11 @@ MIX_MODES = context.JK.MIX_MODES
|
|||
return false
|
||||
|
||||
|
||||
onSelectFocus: (e) ->
|
||||
e.preventDefault()
|
||||
window.JamTrackSearchInput = ''
|
||||
@setState({search:''})
|
||||
|
||||
onSelectBlur: (e) ->
|
||||
|
||||
#@logger.debug("blur time")
|
||||
|
|
|
|||
|
|
@ -60,54 +60,6 @@ describe "JamTrack Shopping", :js => true, :type => :feature, :capybara_feature
|
|||
def not_find_jamtrack jamtrack
|
||||
should_not have_selector(".jamtrack-record[data-jamtrack-id=\"#{jamtrack.id}\"]")
|
||||
end
|
||||
|
||||
describe "Shopping" do
|
||||
|
||||
before(:each) do
|
||||
visit "/client#/jamtrack/search"
|
||||
find('h1', text: 'jamtracks')
|
||||
|
||||
end
|
||||
|
||||
it "shows all JamTracks" do
|
||||
find_jamtrack jt_us
|
||||
find_jamtrack jt_ww
|
||||
find_jamtrack jt_rock
|
||||
end
|
||||
|
||||
=begin
|
||||
# removed for now
|
||||
it "filters with availability" do
|
||||
jk_select('Worldwide', '#jamtrack-find-form #jamtrack_artist')
|
||||
find_jamtrack jt_ww
|
||||
not_find_jamtrack jt_us
|
||||
not_find_jamtrack jt_rock
|
||||
end
|
||||
=end
|
||||
|
||||
it "filters with artist" do
|
||||
jk_select("foobar", '#jamtrack-find-form #jamtrack_artist')
|
||||
find_jamtrack jt_us
|
||||
not_find_jamtrack jt_blues
|
||||
not_find_jamtrack jt_rock
|
||||
not_find_jamtrack jt_ww
|
||||
end
|
||||
|
||||
it "filters with instrument" do
|
||||
jk_select('Electric Guitar', '#jamtrack-find-form #jamtrack_instrument')
|
||||
find_jamtrack jt_us
|
||||
find_jamtrack jt_ww
|
||||
find_jamtrack jt_rock
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
it "sets artist filter" do
|
||||
pending "The item is clearly present, so not currently sure why capybar can't find it"
|
||||
visit "/client?artist=foobar#/jamtrack/search"
|
||||
art = find('#jamtrack_artist')
|
||||
puts "art: #{art}"
|
||||
end
|
||||
|
||||
describe "Shopping Carts" do
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue