// SPDX-License-Identifier: Apache-2.0
import { expect } from 'chai';
import Sinon from 'sinon';
import { LoadDockerImageRequest } from '../../../../../../src/integration/kind/request/load/docker-image-request.js';
describe('LoadDockerImageRequest', () => {
    let builder;
    let request;
    beforeEach(() => {
        // Create a stub for the builder
        builder = {
            subcommands: Sinon.stub().returnsThis(),
        };
    });
    afterEach(() => {
        Sinon.restore();
    });
    describe('apply', () => {
        it('should add load docker-image subcommands to the builder', () => {
            // Create request with null options
            request = new LoadDockerImageRequest(null);
            // Call the apply method
            request.apply(builder);
            // Verify the correct subcommands were added
            expect(builder.subcommands).to.have.been.calledOnceWith('load', 'docker-image');
        });
        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 LoadDockerImageRequest(options);
            // Call the apply method
            request.apply(builder);
            // Verify the correct subcommands were added
            expect(builder.subcommands).to.have.been.calledOnceWith('load', 'docker-image');
            // Verify the options.apply method was called
            expect(options.apply).to.have.been.calledOnceWith(builder);
        });
    });
});
//# sourceMappingURL=docker-image-request.test.js.map