{"size": 1489, "ext": "js", "max_stars_repo_path": "__tests__/src/utils/versioning.spec.js", "max_stars_repo_name": "yardenShacham/marketing_template_engine_service", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "__tests__/src/utils/versioning.spec.js", "max_issues_repo_name": "yardenShacham/marketing_template_engine_service", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "__tests__/src/utils/versioning.spec.js", "max_forks_repo_name": "yardenShacham/marketing_template_engine_service", "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": 36.3170731707, "max_line_length": 81, "alphanum_fraction": 0.6245802552}
import {assert} from 'chai';
import {getNextVersion, getPreviousVersion} from '../../../src/Utils/versioning';

describe('Application Service', () => {

    it('should get increase version by 0.01', () => {
        const startVersion = "0.0.5";
        const expectedNextVersion = "0.0.6";
        assert.equal(getNextVersion(startVersion), expectedNextVersion);
    });

    it('should get increase version by 0.001', () => {
        const startVersion = "0.0.0.5";
        const expectedNextVersion = "0.0.0.6";
        assert.equal(getNextVersion(startVersion), expectedNextVersion);
    });

    it('should get increase version by 0.1', () => {
        const startVersion = "0.5";
        const expectedNextVersion = "0.6";
        assert.equal(getNextVersion(startVersion), expectedNextVersion);
    });

    it('should get decrease version by 0.01', () => {
        const startVersion = "0.0.5";
        const expectedPreviousVersion = "0.0.4";
        assert.equal(getPreviousVersion(startVersion), expectedPreviousVersion);
    });

    it('should get decrease version by 0.001', () => {
        const startVersion = "0.0.0.5";
        const expectedNextVersion = "0.0.0.4";
        assert.equal(getPreviousVersion(startVersion), expectedNextVersion);
    });

    it('should get decrease version by 0.1', () => {
        const startVersion = "0.5";
        const expectedNextVersion = "0.4";
        assert.equal(getPreviousVersion(startVersion), expectedNextVersion);
    });
});