-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(composer): update TagResize feature implementation
- Loading branch information
1 parent
22a404a
commit b8dfb46
Showing
33 changed files
with
890 additions
and
1,136 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
53 changes: 53 additions & 0 deletions
53
...e-composer/src/augmentations/components/three-fiber/common/SvgIconToWidgetSprite.spec.tsx
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,53 @@ | ||
import renderer from 'react-test-renderer'; | ||
import React from 'react'; | ||
|
||
import { DefaultAnchorStatus, SelectedAnchor } from '../../../..'; | ||
import { | ||
ErrorIconSvgString, | ||
InfoIconSvgString, | ||
SelectedIconSvgString, | ||
VideoIconSvgString, | ||
WarningIconSvgString, | ||
} from '../../../../assets'; | ||
|
||
import svgIconToWidgetSprite from './SvgIconToWidgetSprite'; | ||
|
||
describe('svgIconToWidgetSprite', () => { | ||
const icons = [ | ||
['Selected', { key: SelectedAnchor, icon: SelectedIconSvgString }], | ||
['Info', { key: DefaultAnchorStatus.Info, icon: InfoIconSvgString }], | ||
['Warning', { key: DefaultAnchorStatus.Warning, icon: WarningIconSvgString }], | ||
['Error', { key: DefaultAnchorStatus.Error, icon: ErrorIconSvgString }], | ||
['Video', { key: DefaultAnchorStatus.Video, icon: VideoIconSvgString }], | ||
]; | ||
|
||
icons.forEach((value) => { | ||
it(`it should render the ${value[0]} correctly`, () => { | ||
jest.spyOn(window.Math, 'random').mockReturnValue(0.1); | ||
const { key, icon } = value[1] as any; | ||
const container = renderer.create(svgIconToWidgetSprite(icon, key, false, true)); | ||
|
||
expect(container).toMatchSnapshot(); | ||
}); | ||
}); | ||
|
||
icons.forEach((value) => { | ||
it(`it should render the always visible ${value[0]} correctly`, () => { | ||
jest.spyOn(window.Math, 'random').mockReturnValue(0.1); | ||
const { key, icon } = value[1] as any; | ||
const container = renderer.create(svgIconToWidgetSprite(icon, key, true, true)); | ||
|
||
expect(container).toMatchSnapshot(); | ||
}); | ||
}); | ||
|
||
icons.forEach((value) => { | ||
it(`it should render the constant sized ${value[0]} correctly`, () => { | ||
jest.spyOn(window.Math, 'random').mockReturnValue(0.1); | ||
const { key, icon } = value[1] as any; | ||
const container = renderer.create(svgIconToWidgetSprite(icon, key, false, false)); | ||
|
||
expect(container).toMatchSnapshot(); | ||
}); | ||
}); | ||
}); |
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.