Functions/Get-Puppeteer_DeclareDelayFunction.Tests.ps1

describe "BitTitan.Runbooks.UIAutomation/Get-Puppeteer_DeclareDelayFunction" -Tag "module", "unit" {

    # Import the function to test
    . "$($PSScriptRoot)\Get-Puppeteer_DeclareDelayFunction.ps1"

    it "returns the code to generate a delay function" {
        # Call the function
        $output = Get-Puppeteer_DeclareDelayFunction

        # Verify the output
        $output | Should Be @"
// Delays for a specified number of milliseconds
function delay(ms) {
    return new Promise(resolve => {
        setTimeout(resolve, ms);
    });
}
"@

    }
}