Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jessitron committed Jan 11, 2025
1 parent e8a9292 commit 1757238
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ in which jess makes a GUI for the things she wants to accomplish in the honeycom

Problems? create an issue, hopefully it emails me. I'd link you to Office Hours, but I don't want this to seem like an official Honeycomb app in any way.

## test

`npm test`

or to update snapshots, if you've changed the output and the current output is good:

`npm test -- -u`

## weird dependencies

(the .js is included in this repo)
Expand Down
2 changes: 2 additions & 0 deletions test/Datasets.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ const fakeAuth: HnyTricksAuthorization = {
},
permissions: {
canManageDatasets: false,
canSendEvents: false,
canManageColumns: false,
},
environment: {
slug: "env_slug",
Expand Down
12 changes: 6 additions & 6 deletions test/__snapshots__/Datasets.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ exports[`DatasetsTable Renders datasets, the same as before 1`] = `
</tr>
</thead>
<tr>
<th scope="row" class="dataset-name-col">API gateway</th>
<th scope="row" class="dataset-name-col">API gateway<input type="hidden" name="dataset_name_0" value="API%20gateway"></th>
<td><a href="http://localhost:3000/test-region/ui/team_slug/environments/env_slug/datasets/api-gateway/overview" target="_blank" class="link-symbol">⛭</a></td>
<td><a href="http://localhost:3000/test-region/ui/team_slug/environments/env_slug/datasets/api-gateway?query=%7B%22time_range%22%3A5184000%2C%22granularity%22%3A0%2C%22calculations%22%3A%5B%7B%22op%22%3A%22COUNT%22%7D%5D%2C%22filter_combination%22%3A%22AND%22%2C%22limit%22%3A1000%7D" target="_blank" class="link-symbol">📉</a></td>
<td>2</td>
<td><input name="dataset-slug-0" value="api-gateway" type="hidden"><input class="delete-dataset-checkbox" type="checkbox" title="I only delete empty datasets" disabled="true"></td>
<td hx-trigger="intersect" hx-post="/datasets/dc/exists?slug=api-gateway&amp;alias=dc.dataset" hx-include="#auth_data">💬</td>
<td title="API key lacks &apos;Manage Queries and Columns&apos; permission">💂🏽‍♀️</td>
</tr>
<tr>
<th scope="row" class="dataset-name-col">ye olde proxy</th>
<th scope="row" class="dataset-name-col">ye olde proxy<input type="hidden" name="dataset_name_1" value="ye%20olde%20proxy"></th>
<td><a href="http://localhost:3000/test-region/ui/team_slug/environments/env_slug/datasets/olde-proxy/overview" target="_blank" class="link-symbol">⛭</a></td>
<td><a href="http://localhost:3000/test-region/ui/team_slug/environments/env_slug/datasets/olde-proxy?query=%7B%22time_range%22%3A5184000%2C%22granularity%22%3A0%2C%22calculations%22%3A%5B%7B%22op%22%3A%22COUNT%22%7D%5D%2C%22filter_combination%22%3A%22AND%22%2C%22limit%22%3A1000%7D" target="_blank" class="link-symbol">📉</a></td>
<td>365</td>
<td><input name="dataset-slug-1" value="olde-proxy" type="hidden"><input class="delete-dataset-checkbox" type="checkbox" name="delete-dataset-1" checked="true"></td>
<td hx-trigger="intersect" hx-post="/datasets/dc/exists?slug=olde-proxy&amp;alias=dc.dataset" hx-include="#auth_data">💬</td>
<td title="API key lacks &apos;Manage Queries and Columns&apos; permission">💂🏽‍♀️</td>
</tr>
<tfoot>
<tr>
Expand All @@ -36,7 +36,7 @@ exports[`DatasetsTable Renders datasets, the same as before 1`] = `
<td><a href="http://localhost:3000/test-region/ui/team_slug/environments/env_slug/?query=%7B%22time_range%22%3A5184000%2C%22granularity%22%3A0%2C%22calculations%22%3A%5B%7B%22op%22%3A%22COUNT%22%7D%5D%2C%22filter_combination%22%3A%22AND%22%2C%22limit%22%3A1000%7D" target="_blank" class="link-symbol">📈</a></td>
<td>2</td>
<td><button hx-post="/datasets/delete" hx-target="#dataset-section" hx-include="#auth_data">Delete Old Datasets</button></td>
<td><button hx-post="/datasets/dc/create-all?alias=dc.dataset" hx-target="#dataset-section" hx-include="#auth_data" title="make these derived columns">Create</button></td>
<td><a href="http://localhost:3000/test-region/ui/team_slug/environments/env_slug/?query=%7B%22time_range%22%3A7200%2C%22granularity%22%3A0%2C%22breakdowns%22%3A%5B%22dc.dataset%22%5D%2C%22calculations%22%3A%5B%7B%22op%22%3A%22COUNT%22%7D%5D%2C%22orders%22%3A%5B%7B%22op%22%3A%22COUNT%22%2C%22order%22%3A%22descending%22%7D%5D%2C%22havings%22%3A%5B%5D%2C%22trace_joins%22%3A%5B%5D%2C%22limit%22%3A1000%7D" target="_blank"> 📈 </a></td>
</tr>
</tfoot>
</table>
Expand All @@ -63,7 +63,7 @@ exports[`DatasetsTable outputs the same thing as before, for an empty one 1`] =
<td><a href="http://localhost:3000/test-region/ui/team_slug/environments/env_slug/?query=%7B%22time_range%22%3A5184000%2C%22granularity%22%3A0%2C%22calculations%22%3A%5B%7B%22op%22%3A%22COUNT%22%7D%5D%2C%22filter_combination%22%3A%22AND%22%2C%22limit%22%3A1000%7D" target="_blank" class="link-symbol">📈</a></td>
<td>Infinity</td>
<td><button hx-post="/datasets/delete" hx-target="#dataset-section" hx-include="#auth_data">Delete Old Datasets</button></td>
<td><button hx-post="/datasets/dc/create-all?alias=dc.dataset" hx-target="#dataset-section" hx-include="#auth_data" title="make these derived columns">Create</button></td>
<td><a href="http://localhost:3000/test-region/ui/team_slug/environments/env_slug/?query=%7B%22time_range%22%3A7200%2C%22granularity%22%3A0%2C%22breakdowns%22%3A%5B%22dc.dataset%22%5D%2C%22calculations%22%3A%5B%7B%22op%22%3A%22COUNT%22%7D%5D%2C%22orders%22%3A%5B%7B%22op%22%3A%22COUNT%22%2C%22order%22%3A%22descending%22%7D%5D%2C%22havings%22%3A%5B%5D%2C%22trace_joins%22%3A%5B%5D%2C%22limit%22%3A1000%7D" target="_blank"> 📈 </a></td>
</tr>
</tfoot>
</table>
Expand Down

0 comments on commit 1757238

Please sign in to comment.