tldraw/packages
Taha fc302ec4a5
Camera Constraints Tests (#3844)
This PR adds some unit tests for the camera constraints API

I took educated guesses at the intended panning and zoom behaviour for
the editor's constraints. But I couldn't work out what the intended
behaviour was for a couple of the tests, so I've left these ones for
now:

```javascript
describe('Allows mixed values for x and y', () => {
	it.todo('Allows different values to be set for x and y axes')
})
```

```javascript
describe('Contain behavior', () => {
	it.todo(
		'Locks axis until the bounds are bigger than the padded viewport, then allows "inside" panning'
	)
})
```

I also edited some earlier tests so they now use chaining, to be
consistent with the other tests and hopefully easier to read.

### Change Type

<!--  Please select a 'Scope' label ️ -->

- [ ] `sdk` — Changes the tldraw SDK
- [ ] `dotcom` — Changes the tldraw.com web app
- [ ] `docs` — Changes to the documentation, examples, or templates.
- [ ] `vs code` — Changes to the vscode plugin
- [x] `internal` — Does not affect user-facing stuff

<!--  Please select a 'Type' label ️ -->

- [ ] `bugfix` — Bug fix
- [ ] `feature` — New feature
- [ ] `improvement` — Improving existing features
- [ ] `chore` — Updating dependencies, other boring stuff
- [ ] `galaxy brain` — Architectural changes
- [x] `tests` — Changes to any test code
- [ ] `tools` — Changes to infrastructure, CI, internal scripts,
debugging tools, etc.
- [ ] `dunno` — I don't know


### Test Plan

1. Add a step-by-step description of how to test your PR here.
2.

- [ ] Unit Tests
- [ ] End to end tests

### Release Notes

- Adds tests for the camera constraints api
2024-06-03 08:23:18 +00:00
..
assets Add heart geo shape (#3787) 2024-05-24 13:04:28 +00:00
dotcom-shared Force interface instead of type for better docs (#3815) 2024-05-22 15:55:49 +00:00
editor Move constants to options prop (#3799) 2024-05-28 14:22:03 +00:00
namespaced-tldraw Don't check api.json files into git (#3565) 2024-04-24 15:58:26 +00:00
state Force interface instead of type for better docs (#3815) 2024-05-22 15:55:49 +00:00
store Force interface instead of type for better docs (#3815) 2024-05-22 15:55:49 +00:00
tldraw Camera Constraints Tests (#3844) 2024-06-03 08:23:18 +00:00
tlschema Add heart geo shape (#3787) 2024-05-24 13:04:28 +00:00
tlsync Force interface instead of type for better docs (#3815) 2024-05-22 15:55:49 +00:00
utils Force interface instead of type for better docs (#3815) 2024-05-22 15:55:49 +00:00
validate Force interface instead of type for better docs (#3815) 2024-05-22 15:55:49 +00:00