"use strict";
/**
 * Test transitionary module for invalid bucket state
 *
 *  Copyright (C) 2010-2020 R-T Specialty, LLC.
 *
 *  This file is part of liza.
 *
 *  liza is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
Object.defineProperty(exports, "__esModule", { value: true });
var chai_1 = require("chai");
var sut = require("../../src/validate/invalid");
describe('invalidate', function () {
    it('creates invalid strings', function () {
        chai_1.expect(sut.isInvalid(sut.invalidate(''))).to.be.true;
    });
    it('recovers values from invalid strings (identity)', function () {
        var given = 'some invalid value';
        chai_1.expect(sut.recoverValue(sut.invalidate(given))).to.equal(given);
    });
    it('recovers values from invalid strings without marker (identity)', function () {
        var given = 'another invalid value';
        chai_1.expect(sut.recoverValue(sut.invalidateWithoutPrintableMarker(given))).to.equal(given);
    });
    it('does nothing when recovering non-invalid values', function () {
        var given = 'ok';
        chai_1.expect(sut.recoverValue(given)).to.equal(given);
    });
    it('clears invalid values', function () {
        chai_1.expect(sut.clearInvalid(sut.invalidate('foo'))).to.equal('');
    });
    it('does not clear valid values', function () {
        var given = 'ok';
        chai_1.expect(sut.clearInvalid(given)).to.equal(given);
    });
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW52YWxpZC10ZXN0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaW52YWxpZC10ZXN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7OztHQW1CRzs7QUFFSCw2QkFBNEI7QUFFNUIsZ0RBQWt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