-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add method to allow simulation of messages
- Loading branch information
1 parent
66b7714
commit e248991
Showing
2 changed files
with
35 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,35 @@ | ||
import { sendEvent } from 'lib/socket' | ||
|
||
export default function TestPage () { | ||
return ( | ||
<> | ||
<div style={{padding: '1rem'}}> | ||
<h1>Test Page</h1> | ||
</> | ||
<hr/> | ||
<h2>Simulate Events</h2> | ||
<p> | ||
Send a test event to all connected clients. | ||
</p> | ||
<input id='debug_event_name' defaultValue='Test' style={{textTransform: 'none'}}/> | ||
<p> | ||
<button onClick={() => { | ||
sendEvent('testMessage', { name: document.getElementById('debug_event_name').value }) | ||
}}>Send Event</button> | ||
</p> | ||
<h2>Simulate Log Entry</h2> | ||
<p> | ||
Simulate an event triggered after an in-game log entry is fired. | ||
</p> | ||
<input id='debug_log_entry_name' defaultValue='Scan' style={{textTransform: 'none'}}/> | ||
<p> | ||
<button onClick={() => { | ||
sendEvent('testMessage', { | ||
name: 'newLogEntry', | ||
message: { | ||
event: document.getElementById('debug_log_entry_name').value } | ||
} | ||
) | ||
}}>Simulate Log Entry</button> | ||
</p> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters