-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix10_move properties control to the operations group, and adjust sha…
…re svg size (#863)
- Loading branch information
1 parent
cde6bc1
commit ece4952
Showing
6 changed files
with
104 additions
and
78 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React from 'react' | ||
import {__getIfcViewerAPIExtendedMockSingleton} from 'web-ifc-viewer' | ||
import {act, render, fireEvent, renderHook} from '@testing-library/react' | ||
import ShareMock from '../ShareMock' | ||
import useStore from '../store/useStore' | ||
import OperationsGroup from './OperationsGroup' | ||
|
||
|
||
describe('OperationsGroup', () => { | ||
const deselectItems = jest.fn() | ||
let viewer | ||
|
||
beforeAll(async () => { | ||
const {result} = renderHook(() => useStore((state) => state)) | ||
viewer = __getIfcViewerAPIExtendedMockSingleton() | ||
viewer.isolator = { | ||
toggleIsolationMode: jest.fn(), | ||
hideSelectedElements: jest.fn(), | ||
unHideAllElements: jest.fn(), | ||
} | ||
await act(() => { | ||
result.current.setViewer(viewer) | ||
}) | ||
}) | ||
|
||
it('should render and trigger Properties button when a selected element is present', async () => { | ||
const {result} = renderHook(() => useStore((state) => state)) | ||
await act(() => { | ||
result.current.setSelectedElement({id: 123}) | ||
}) | ||
const {queryByTitle} = render( | ||
<ShareMock | ||
initialEntries={['/v/p/index.ifc#p:x']} | ||
> | ||
<OperationsGroup deselectItems={deselectItems}/> | ||
</ShareMock>, | ||
) | ||
const propertiesButton = queryByTitle('Properties') | ||
fireEvent.click(propertiesButton) | ||
expect(propertiesButton).toBeInTheDocument() | ||
}) | ||
}) |
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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.