-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathtest-browser-build.html
More file actions
30 lines (26 loc) · 1.13 KB
/
test-browser-build.html
File metadata and controls
30 lines (26 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!DOCTYPE html>
<html>
<head>
<title>Test Browser Build</title>
</head>
<body>
<h1>Testing pgflow Browser Build</h1>
<pre id="output"></pre>
<script src="dist/pgflow-client.browser.js"></script>
<script>
const output = document.getElementById('output');
// Test that global is available
output.textContent += `window.pgflow exists: ${!!window.pgflow}\n`;
output.textContent += `window.pgflow.createClient exists: ${typeof window.pgflow.createClient === 'function'}\n`;
output.textContent += `window.pgflow.PgflowClient exists: ${typeof window.pgflow.PgflowClient === 'function'}\n`;
// Test factory function
const mockSupabase = {
channel: () => ({ on: () => {}, subscribe: () => {} }),
schema: () => ({ from: () => {}, rpc: () => {} })
};
const client = window.pgflow.createClient(mockSupabase);
output.textContent += `Client created successfully: ${!!client}\n`;
output.textContent += `Client has startFlow method: ${typeof client.startFlow === 'function'}\n`;
</script>
</body>
</html>