-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: display meter grid in map when uploading floor plan image
Refs: #14
- Loading branch information
Showing
9 changed files
with
156 additions
and
80 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
workspaces/frontend/src/components/FloorPlanPaneSideBar.spec.ts
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { beforeEach, describe, expect, it, vi } from 'vitest'; | ||
import { fireEvent, render, screen } from '@testing-library/svelte'; | ||
import type { ImageDimensions } from '../ts/ImageDimensions'; | ||
import { viewport } from '../ts/ViewportSingleton'; | ||
import FloorPlanPaneSideBar from './FloorPlanPaneSideBar.svelte'; | ||
|
||
describe('FloorPlanPaneSideBar', () => { | ||
it('should be initialized', async () => { | ||
render(FloorPlanPaneSideBar); | ||
|
||
expect(screen.getByTestId('floorPlanPane')).toBeInTheDocument(); | ||
expect(screen.getByTestId('floorPlanPane-form')).toBeInTheDocument(); | ||
}); | ||
|
||
describe('initialized with a marker', () => { | ||
beforeEach(async () => { | ||
viewport.getImageDimensions = vi.fn(() => { | ||
return { width: 100, height: 200 } as ImageDimensions; | ||
}); | ||
|
||
render(FloorPlanPaneSideBar); | ||
|
||
fireEvent(document, new CustomEvent('floorplan', { detail: { action: 'open' } })); | ||
}); | ||
|
||
it('should display image dimensions', async () => { | ||
expect(screen.getByTestId('floorPlanPane-dimensions')).toBeInTheDocument(); | ||
expect(screen.getByTestId('floorPlanPane-dimensions').textContent).toEqual('100 x 200'); | ||
}); | ||
}); | ||
}); |
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
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
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
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
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
Oops, something went wrong.