Could anyone give me a pointer on how I test the following code in QUnit?
function ChooseBranch()
{
var BranchPromise = getBranches();
BranchPromise.then(function (BranchData) {
var BranchOptions = [];
$.each(BranchData, function (i, d) {
BranchOptions.push(d.BranchDescription)
});
swal({
title: 'Delivery Branch',
text: 'Please choose the branch below where the customer would like the order delivered',
showCancelButton: false,
input: 'select',
inputOptions: BranchOptions
}).then(function (result) {
DeliveryType = "Other";
DeliverToBranch = BranchData[result].BranchCode;
ItemOrder();
});
});
}
I have tried getting the sweetalert2 dialog select first option, but it doesn't appear in the dom until after the test has failed? I basically want to test that the swal is visible.