{"size": 1976, "ext": "js", "max_stars_repo_path": "test/unit/wrappers/testDeceasedWrapper.js", "max_stars_repo_name": "uk-gov-mirror/hmcts.probate-frontend", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "test/unit/wrappers/testDeceasedWrapper.js", "max_issues_repo_name": "uk-gov-mirror/hmcts.probate-frontend", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "test/unit/wrappers/testDeceasedWrapper.js", "max_forks_repo_name": "uk-gov-mirror/hmcts.probate-frontend", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 35.9272727273, "max_line_length": 75, "alphanum_fraction": 0.516194332}
'use strict';

const DeceasedWrapper = require('app/wrappers/Deceased');
const expect = require('chai').expect;

describe('Deceased.js', () => {
    describe('hasAlias()', () => {
        it('should return true when the deceased has an alias', (done) => {
            const data = {alias: 'optionYes'};
            const deceasedWrapper = new DeceasedWrapper(data);
            expect(deceasedWrapper.hasAlias()).to.equal(true);
            done();
        });

        describe('should return false', () => {
            it('when the deceased does not have an alias', (done) => {
                const data = {alias: 'optionNo'};
                const deceasedWrapper = new DeceasedWrapper(data);
                expect(deceasedWrapper.hasAlias()).to.equal(false);
                done();
            });

            it('when there is no deceased data', (done) => {
                const deceasedWrapper = new DeceasedWrapper();
                expect(deceasedWrapper.hasAlias()).to.equal(false);
                done();
            });
        });
    });

    describe('isMarried()', () => {
        it('should return true when the deceased is married', (done) => {
            const data = {married: 'optionYes'};
            const deceasedWrapper = new DeceasedWrapper(data);
            expect(deceasedWrapper.isMarried()).to.equal(true);
            done();
        });

        describe('should return false', () => {
            it('when the deceased is not married', (done) => {
                const data = {married: 'optionNo'};
                const deceasedWrapper = new DeceasedWrapper(data);
                expect(deceasedWrapper.isMarried()).to.equal(false);
                done();
            });

            it('when there is no deceased data', (done) => {
                const deceasedWrapper = new DeceasedWrapper();
                expect(deceasedWrapper.isMarried()).to.equal(false);
                done();
            });
        });
    });
});
