Skip to content

Commit

Permalink
Fix stories and snaps
Browse files Browse the repository at this point in the history
  • Loading branch information
kimlisa committed Sep 13, 2024
1 parent 433cb6f commit 35ccb64
Show file tree
Hide file tree
Showing 14 changed files with 3,144 additions and 5,233 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1750,11 +1750,12 @@ exports[`render Roles 1`] = `
<div
class="c3"
>
<div
<form
class="c4"
>
<input
class="c5"
name="searchValue"
placeholder="Search..."
value=""
/>
Expand All @@ -1765,7 +1766,7 @@ exports[`render Roles 1`] = `
class="c7"
/>
</div>
</div>
</form>
</div>
<div
class="c8 c9"
Expand Down
4 changes: 2 additions & 2 deletions web/packages/teleport/src/Audit/Audit.story.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import { LoadedSample, AllPossibleEvents } from './Audit.story';

test('loaded audit log screen', async () => {
const { container } = render(<LoadedSample />);
await screen.findByText(/Audit Log/);
expect(container.firstChild).toMatchSnapshot();
await screen.findAllByText(/Showing/);
expect(container).toMatchSnapshot();
});

test('list of all events', async () => {
Expand Down
4 changes: 4 additions & 0 deletions web/packages/teleport/src/Audit/Audit.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default {

export const LoadedSample = () => {
const ctx = new Context();
ctx.clusterService.fetchClusters = () => Promise.resolve([]);
ctx.auditService.fetchEvents = () =>
Promise.resolve({ events: eventsSample, startKey: '' });

Expand All @@ -40,6 +41,7 @@ export const LoadedSample = () => {

export const LoadedFetchMore = () => {
const ctx = new Context();
ctx.clusterService.fetchClusters = () => Promise.resolve([]);
ctx.auditService.fetchEvents = () =>
Promise.resolve({ events, startKey: 'any-text' });

Expand All @@ -48,12 +50,14 @@ export const LoadedFetchMore = () => {

export const Processing = () => {
const ctx = new Context();
ctx.clusterService.fetchClusters = () => Promise.resolve([]);
ctx.auditService.fetchEvents = () => new Promise(() => null);
return render(ctx);
};

export const Failed = () => {
const ctx = new Context();
ctx.clusterService.fetchClusters = () => Promise.resolve([]);
ctx.auditService.fetchEvents = () =>
Promise.reject(new Error('server error'));
return render(ctx);
Expand Down
Loading

0 comments on commit 35ccb64

Please sign in to comment.