// SPDX-License-Identifier: Apache-2.0
import { expect } from 'chai';
import sinon from 'sinon';
import { describe, it } from 'mocha';
import { AddRepoOptions } from '../../../../../src/integration/helm/model/add/add-repo-options.js';
import { AddRepoOptionsBuilder } from '../../../../../src/integration/helm/model/add/add-repo-options-builder.js';
describe('AddRepoOptionsBuilder Tests', () => {
    it('should build AddRepoOptions with default values', () => {
        const options = new AddRepoOptionsBuilder().build();
        expect(options).to.not.be.null;
        expect(options.forceUpdate).to.be.false;
    });
    it('should build AddRepoOptions with forceUpdate = true', () => {
        const options = new AddRepoOptionsBuilder().forceUpdate(true).build();
        expect(options).to.not.be.null;
        expect(options.forceUpdate).to.be.true;
    });
});
describe('AddRepoOptions Tests', () => {
    it('should set forceUpdate correctly via constructor', () => {
        const optionsTrue = new AddRepoOptions(true);
        const optionsFalse = new AddRepoOptions(false);
        expect(optionsTrue.forceUpdate).to.be.true;
        expect(optionsFalse.forceUpdate).to.be.false;
    });
    it('should apply --force-update flag when set', () => {
        const flagStub = sinon.stub().returnsThis();
        const builderMock = { flag: flagStub };
        const options = new AddRepoOptions(true);
        options.apply(builderMock);
        expect(flagStub.calledWith('--force-update')).to.be.true;
    });
    it('should not apply --force-update flag when not set', () => {
        const flagStub = sinon.stub().returnsThis();
        const builderMock = { flag: flagStub };
        const options = new AddRepoOptions(false);
        options.apply(builderMock);
        expect(flagStub.calledWith('--force-update')).to.be.false;
    });
});
//# sourceMappingURL=add-repo-options-builder.test.js.map