Exemplo n.º 1
0
        it('getView should return AddCardSc if it is turned on in OrgSettings', function() {
            Playtech.Variables.useSafeChargeToken = true;
            var cashierModel = new CashierModel({
                config: {
                    cashierType: 'ADD_PAYMENT_METHOD'
                }
            });

            cashierModel.getView().should.to.be.instanceof(AddcardScView);
        });
Exemplo n.º 2
0
    describe('Cashier model', function() {
        var cashierModel = new CashierModel({
                config: {}
            }),
            mapping = [
                {
                    cashierType: 'DEPOSIT',
                    view: DepositView
                }, {
                    cashierType: 'WITHDRAW',
                    view: WithdrawView
                }, {
                    cashierType: 'TRANSACTION_HISTORY',
                    view: TransactionHistoryView
                }, {
                    cashierType: 'PENDING_WITHDRAWALS',
                    view: PendingView
                }, {
                    cashierType: 'ADD_PAYMENT_METHOD',
                    view: AddcardView
                }
            ];

        mapping.forEach(function(payment) {
            it('getView method should return correct view, depends on config (' + payment.cashierType + ')', function() {
                cashierModel.set('config', {cashierType: payment.cashierType});
                cashierModel.getView().should.to.be.instanceof(payment.view);
            });
        });

        it('getView method should return deposit view by default', function() {
            cashierModel.set('config', {cashierType: ''});
            cashierModel.getView().should.to.be.instanceof(DepositView);
        });

        it('getView should return AddCardSc if it is turned on in OrgSettings', function() {
            Playtech.Variables.useSafeChargeToken = true;
            var cashierModel = new CashierModel({
                config: {
                    cashierType: 'ADD_PAYMENT_METHOD'
                }
            });

            cashierModel.getView().should.to.be.instanceof(AddcardScView);
        });
    });
Exemplo n.º 3
0
 it('getView method should return deposit view by default', function() {
     cashierModel.set('config', {cashierType: ''});
     cashierModel.getView().should.to.be.instanceof(DepositView);
 });
Exemplo n.º 4
0
 it('getView method should return correct view, depends on config (' + payment.cashierType + ')', function() {
     cashierModel.set('config', {cashierType: payment.cashierType});
     cashierModel.getView().should.to.be.instanceof(payment.view);
 });