toiljs 0.0.78 → 0.0.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/build/client/.tsbuildinfo +1 -1
- package/build/compiler/.tsbuildinfo +1 -1
- package/build/compiler/generate.js +2 -2
- package/build/devserver/.tsbuildinfo +1 -1
- package/build/devserver/ssr.js +15 -1
- package/package.json +1 -1
- package/server/runtime/ssr/slots.ts +8 -0
- package/src/client/components/Image.tsx +9 -8
- package/src/compiler/generate.ts +2 -2
- package/src/devserver/ssr.ts +23 -1
- package/test/built-ssr.test.ts +50 -0
- package/test/dom/Image.test.tsx +2 -2
package/test/dom/Image.test.tsx
CHANGED
|
@@ -41,7 +41,7 @@ describe('Image', () => {
|
|
|
41
41
|
expect(img.getAttribute('fetchpriority')).toBe('high');
|
|
42
42
|
});
|
|
43
43
|
|
|
44
|
-
it('fill wraps the image in a
|
|
44
|
+
it('fill wraps the image in a box; the image lays out via a class, not inline styles', () => {
|
|
45
45
|
const { getByAltText } = render(
|
|
46
46
|
<Image
|
|
47
47
|
src="/bg.png"
|
|
@@ -58,7 +58,7 @@ describe('Image', () => {
|
|
|
58
58
|
expect(img.style.position).toBe('');
|
|
59
59
|
// objectFit is genuinely per-instance, so it stays inline.
|
|
60
60
|
expect(img.style.objectFit).toBe('cover');
|
|
61
|
-
// The image is wrapped in a
|
|
61
|
+
// The image is wrapped in a <span> box the caller sizes, so it fills the box, not the page.
|
|
62
62
|
const box = img.parentElement as HTMLElement;
|
|
63
63
|
expect(box.tagName).toBe('SPAN');
|
|
64
64
|
expect(box.classList.contains('toil-img-fill-box')).toBe(true);
|