0
誰でも私がどのようにQUnitで次のコードをテストするかについてのポインタを教えてもらえますか?Sweetalert2とQunit.js
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();
});
});
}
私はsweetalert2ダイアログが最初のオプションを選択し取得しようとしたが、それはテストが失敗した後まで、DOMに表示されませんか?私は基本的にはスワールが見えることをテストしたい。
私の頭の中で明確にそれを入れていること、ありがとうございます!私はアラートの表示をそれ自身の機能に移しました。それが可視かどうかをテストすることができます。 – dave