[FIX] website_sale: test tour and activate website_event_sale test

bzr revid: chm@openerp.com-20140331151237-ec0j7ywfsbjsw83k
This commit is contained in:
chm@openerp.com 2014-03-31 17:12:37 +02:00
parent 94cf489dfc
commit fd593a3049
3 changed files with 14 additions and 11 deletions

View File

@ -306,7 +306,7 @@ var T = website.Tour = {
window.location.hash = ""; window.location.hash = "";
T.saveState(state.id, state.mode, state.step_id); T.saveState(state.id, state.mode, state.step_id);
} }
if (!state.id) { if (!state.id || !T.tours[state.id]) {
return; return;
} }
state.tour = T.tours[state.id]; state.tour = T.tours[state.id];
@ -349,20 +349,21 @@ var T = website.Tour = {
clearTimeout(T.testtimer); clearTimeout(T.testtimer);
T.closePopover(); T.closePopover();
}, },
testRunning: 0,
running: function () { running: function () {
var state = T.getState(); setTimeout(function () {
if (state) {
T.registerSteps(state.tour);
if ($.ajaxBusy) { if ($.ajaxBusy) {
$(document).ajaxStop(function() { $(document).ajaxStop(function() {
setTimeout(function () { var state = T.getState();
T.nextStep(); T.registerSteps(state.tour);
},0); T.nextStep();
}); });
} else { } else {
var state = T.getState();
T.registerSteps(state.tour);
T.nextStep(); T.nextStep();
} }
} },0);
}, },
check: function (step) { check: function (step) {
return (step && return (step &&

View File

@ -1 +1 @@
#import test_ui import test_ui

View File

@ -1,8 +1,10 @@
import os
import openerp.tests import openerp.tests
inject = [ inject = [
"./../../../website/static/src/js/website.tour.test.js", ("openerp.website.Tour", os.path.join(os.path.dirname(__file__), '../../website/static/src/js/website.tour.js')),
"./../../../website_event_sale/static/src/js/website.tour.event_sale.js", ("openerp.website.Tour.tours.event_buy_tickets", os.path.join(os.path.dirname(__file__), "../static/src/js/website.tour.event_sale.js")),
] ]
@openerp.tests.common.at_install(False) @openerp.tests.common.at_install(False)