Skip to content

armgit / mimik

Public Imported from GitHub
0

🎬 A browser extension and desktop app that turns your clicks into step-by-step guides with annotated screenshots πŸ“–

test: align export fixtures with the current Step and Screenshot types

Luis Ortiz70ba248d61df
diff --git a/src/core/export/__tests__/html-export.test.ts b/src/core/export/__tests__/html-export.test.ts
index a0c6fbc..200aeff 100644
--- a/src/core/export/__tests__/html-export.test.ts
+++ b/src/core/export/__tests__/html-export.test.ts
@@ -26,19 +26,20 @@ function makeStep(index: number): Step {
description: `Click the button ${index}`,
action: 'click',
url: 'https://example.com/page',
- createdAt: guide.createdAt,
- } as Step;
+ timestamp: guide.createdAt,
+ };
}
function makeScreenshot(stepId: string, edits?: Screenshot['edits']): Screenshot {
return {
id: `shot-${stepId}`,
stepId,
- guideId: 'guide-1',
blob: new Blob(['raw'], { type: 'image/png' }),
- createdAt: guide.createdAt,
+ mimeType: 'image/png',
+ width: 1280,
+ height: 800,
edits,
- } as Screenshot;
+ };
}
function render(steps: Step[], screenshots: Map<string, Screenshot>) {
diff --git a/src/ui/fullview/__tests__/ExportPreviewModal.test.tsx b/src/ui/fullview/__tests__/ExportPreviewModal.test.tsx
index 1fa156a..81073f3 100644
--- a/src/ui/fullview/__tests__/ExportPreviewModal.test.tsx
+++ b/src/ui/fullview/__tests__/ExportPreviewModal.test.tsx
@@ -36,12 +36,27 @@ const guide: Guide = {
function makeGuideOf(stepCount: number) {
const steps = Array.from(
{ length: stepCount },
- (_, i) => ({ id: `step-${i}`, guideId: 'guide-1', index: i, description: `Step ${i}`, action: 'click' }) as Step,
+ (_, i): Step => ({
+ id: `step-${i}`,
+ guideId: 'guide-1',
+ index: i,
+ description: `Step ${i}`,
+ action: 'click',
+ url: 'https://example.com',
+ timestamp: 0,
+ }),
);
const screenshots = new Map<string, Screenshot>(
steps.map((s) => [
s.id,
- { id: `shot-${s.id}`, stepId: s.id, guideId: 'guide-1', blob: new Blob(['x']) } as Screenshot,
+ {
+ id: `shot-${s.id}`,
+ stepId: s.id,
+ blob: new Blob(['x']),
+ mimeType: 'image/png',
+ width: 1280,
+ height: 800,
+ },
]),
);
return { steps, screenshots };