"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var chai_1 = require("chai");
var getPayButtonState_1 = require("../../../src/app/TopUp/getPayButtonState");
var TopUpProviderSupportService_1 = require("../../../src/core/services/TopUpProviderSupportService");
var countries_1 = require("../../../src/core/utils/countries");
var TopUpProvider_1 = require("../../../src/core/models/TopUpProvider");
describe('getPayButtonState', function () {
    var topUpProviderSupportService = new TopUpProviderSupportService_1.TopUpProviderSupportService(countries_1.countries);
    describe('hidden', function () {
        it('topUpMethod is undefined', function () {
            chai_1.expect(getPayButtonState_1.getPayButtonState(undefined, topUpProviderSupportService, '0', undefined)).to.eq('hidden');
            chai_1.expect(getPayButtonState_1.getPayButtonState(undefined, topUpProviderSupportService, '1', undefined)).to.eq('hidden');
            chai_1.expect(getPayButtonState_1.getPayButtonState(TopUpProvider_1.TopUpProvider.SAFELLO, topUpProviderSupportService, '0', undefined)).to.eq('hidden');
            chai_1.expect(getPayButtonState_1.getPayButtonState(TopUpProvider_1.TopUpProvider.RAMP, topUpProviderSupportService, '0', undefined)).to.eq('hidden');
        });
        it('topUpMethod is crypto', function () {
            chai_1.expect(getPayButtonState_1.getPayButtonState(undefined, topUpProviderSupportService, '0', 'crypto')).to.eq('hidden');
            chai_1.expect(getPayButtonState_1.getPayButtonState(undefined, topUpProviderSupportService, '1', 'crypto')).to.eq('hidden');
            chai_1.expect(getPayButtonState_1.getPayButtonState(TopUpProvider_1.TopUpProvider.SAFELLO, topUpProviderSupportService, '0', 'crypto')).to.eq('hidden');
            chai_1.expect(getPayButtonState_1.getPayButtonState(TopUpProvider_1.TopUpProvider.RAMP, topUpProviderSupportService, '0', 'crypto')).to.eq('hidden');
        });
    });
    describe('disabled', function () {
        it('topUpProvider is not selected', function () {
            chai_1.expect(getPayButtonState_1.getPayButtonState(undefined, topUpProviderSupportService, '10', 'fiat')).to.eq('disabled');
            chai_1.expect(getPayButtonState_1.getPayButtonState(undefined, topUpProviderSupportService, '-1', 'fiat')).to.eq('disabled');
            chai_1.expect(getPayButtonState_1.getPayButtonState(undefined, topUpProviderSupportService, '', 'fiat')).to.eq('disabled');
        });
        it('ramp with amount <= 0 or invalid', function () {
            chai_1.expect(getPayButtonState_1.getPayButtonState(TopUpProvider_1.TopUpProvider.RAMP, topUpProviderSupportService, '0', 'fiat')).to.eq('disabled');
            chai_1.expect(getPayButtonState_1.getPayButtonState(TopUpProvider_1.TopUpProvider.RAMP, topUpProviderSupportService, '-1', 'fiat')).to.eq('disabled');
            chai_1.expect(getPayButtonState_1.getPayButtonState(TopUpProvider_1.TopUpProvider.RAMP, topUpProviderSupportService, '', 'fiat')).to.eq('disabled');
        });
    });
    describe('active', function () {
        it('safello', function () {
            chai_1.expect(getPayButtonState_1.getPayButtonState(TopUpProvider_1.TopUpProvider.SAFELLO, topUpProviderSupportService, '10', 'fiat')).to.eq('active');
            chai_1.expect(getPayButtonState_1.getPayButtonState(TopUpProvider_1.TopUpProvider.SAFELLO, topUpProviderSupportService, '-1', 'fiat')).to.eq('active');
            chai_1.expect(getPayButtonState_1.getPayButtonState(TopUpProvider_1.TopUpProvider.SAFELLO, topUpProviderSupportService, '', 'fiat')).to.eq('active');
        });
        it('ramp with amount > 0', function () {
            chai_1.expect(getPayButtonState_1.getPayButtonState(TopUpProvider_1.TopUpProvider.RAMP, topUpProviderSupportService, '5', 'fiat')).to.eq('active');
        });
    });
});
//# sourceMappingURL=getPayButtonState.test.js.map