← back to Cypress Awards

frontend/src/debug-firms.html

56 lines

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Debug Settlement Firms</title>
    <style>
        body { font-family: Arial; padding: 20px; }
        .success { color: green; background: #e8f5e9; padding: 10px; margin: 10px 0; }
        .error { color: red; background: #ffebee; padding: 10px; margin: 10px 0; }
    </style>
</head>
<body>
    <h1>Debug: Settlement Firms Page</h1>
    <div id="status"></div>
    <div id="content"></div>

    <script>
        const statusDiv = document.getElementById('status');
        const contentDiv = document.getElementById('content');

        statusDiv.innerHTML = '<div class="success">JavaScript is executing!</div>';

        // Test if we can fetch settlement-firms.html
        fetch('/settlement-firms.html')
            .then(response => response.text())
            .then(html => {
                statusDiv.innerHTML += '<div class="success">Successfully fetched settlement-firms.html</div>';

                // Check if settlementFirms array exists in the HTML
                if (html.includes('const settlementFirms = [')) {
                    statusDiv.innerHTML += '<div class="success">settlementFirms array found in HTML</div>';
                } else {
                    statusDiv.innerHTML += '<div class="error">settlementFirms array NOT found!</div>';
                }

                // Check if renderFirms function exists
                if (html.includes('function renderFirms()')) {
                    statusDiv.innerHTML += '<div class="success">renderFirms() function found</div>';
                } else {
                    statusDiv.innerHTML += '<div class="error">renderFirms() function NOT found!</div>';
                }

                // Check if styles.css is referenced
                if (html.includes('styles.css')) {
                    statusDiv.innerHTML += '<div class="success">styles.css is linked</div>';
                } else {
                    statusDiv.innerHTML += '<div class="error">styles.css NOT linked!</div>';
                }
            })
            .catch(error => {
                statusDiv.innerHTML += '<div class="error">Error fetching page: ' + error.message + '</div>';
            });
    </script>
</body>
</html>