// SPDX-License-Identifier: Apache-2.0
import { expect } from 'chai';
import Sinon from 'sinon';
import { ExportKubeConfigRequest } from '../../../../../../src/integration/kind/request/export/export-kubeconfig-request.js';
describe('ExportKubeConfigRequest', () => {
    let builder;
    let request;
    beforeEach(() => {
        // Create a stub for the builder
        builder = {
            subcommands: Sinon.stub().returnsThis(),
        };
    });
    afterEach(() => {
        Sinon.restore();
    });
    describe('apply', () => {
        it('should add export kubeconfig subcommands to the builder', () => {
            // Create request with null options
            request = new ExportKubeConfigRequest(null);
            // Call the apply method
            request.apply(builder);
            // Verify the correct subcommands were added
            expect(builder.subcommands).to.have.been.calledOnceWith('export', 'kubeconfig');
        });
        it('should delegate to options.apply when options are provided', () => {
            // Create mock options with a stub for apply method
            const options = { apply: Sinon.stub() };
            // Create request with options
            request = new ExportKubeConfigRequest(options);
            // Call the apply method
            request.apply(builder);
            // Verify the correct subcommands were added
            expect(builder.subcommands).to.have.been.calledOnceWith('export', 'kubeconfig');
            // Verify the options.apply method was called
            expect(options.apply).to.have.been.calledOnceWith(builder);
        });
    });
});
//# sourceMappingURL=export-kubeconfig-request.test.js.map