@spectrum-web-components/thumbnail 0.6.0 → 0.6.1
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/package.json +3 -4
- package/sp-thumbnail.dev.js +1 -0
- package/sp-thumbnail.dev.js.map +1 -1
- package/sp-thumbnail.js +1 -1
- package/sp-thumbnail.js.map +2 -2
- package/src/Thumbnail.dev.js +1 -0
- package/src/Thumbnail.dev.js.map +1 -1
- package/src/Thumbnail.js +1 -1
- package/src/Thumbnail.js.map +2 -2
- package/src/index.dev.js +1 -0
- package/src/index.dev.js.map +1 -1
- package/src/index.js +1 -1
- package/src/index.js.map +1 -1
- package/src/spectrum-thumbnail.css.dev.js +1 -0
- package/src/spectrum-thumbnail.css.dev.js.map +1 -1
- package/src/spectrum-thumbnail.css.js +1 -1
- package/src/spectrum-thumbnail.css.js.map +2 -2
- package/src/thumbnail.css.dev.js +1 -0
- package/src/thumbnail.css.dev.js.map +1 -1
- package/src/thumbnail.css.js +1 -1
- package/src/thumbnail.css.js.map +2 -2
- package/stories/images.js +4 -1
- package/stories/images.js.map +1 -1
- package/stories/thumbnail-sizes.stories.js +21 -4
- package/stories/thumbnail-sizes.stories.js.map +1 -1
- package/stories/thumbnail.stories.js +51 -16
- package/stories/thumbnail.stories.js.map +1 -1
- package/test/benchmark/basic-test.js +7 -2
- package/test/benchmark/basic-test.js.map +1 -1
- package/test/thumbnail-sizes.test-vrt.js +4 -1
- package/test/thumbnail-sizes.test-vrt.js.map +2 -2
- package/test/thumbnail.test-vrt.js +4 -1
- package/test/thumbnail.test-vrt.js.map +2 -2
- package/test/thumbnail.test.js +41 -9
- package/test/thumbnail.test.js.map +1 -1
|
@@ -1,6 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
import { html } from "@spectrum-web-components/base";
|
|
3
|
+
import "@spectrum-web-components/thumbnail/sp-thumbnail.js";
|
|
4
|
+
import { thumbnail as image } from "./images.js";
|
|
5
|
+
export default {
|
|
6
|
+
title: "Thumbnail/Sizes",
|
|
7
|
+
component: "sp-thumbnail"
|
|
8
|
+
};
|
|
9
|
+
const thumbnail = ({
|
|
10
|
+
size
|
|
11
|
+
}) => {
|
|
12
|
+
return html`
|
|
13
|
+
<sp-thumbnail size=${size}>
|
|
14
|
+
<img src=${image} alt="Woman crouching" />
|
|
4
15
|
</sp-thumbnail>
|
|
5
|
-
`;
|
|
16
|
+
`;
|
|
17
|
+
};
|
|
18
|
+
export const XXS = () => thumbnail({ size: "xxs" });
|
|
19
|
+
export const XS = () => thumbnail({ size: "xs" });
|
|
20
|
+
export const s = () => thumbnail({ size: "s" });
|
|
21
|
+
export const m = () => thumbnail({ size: "m" });
|
|
22
|
+
export const l = () => thumbnail({ size: "l" });
|
|
6
23
|
//# sourceMappingURL=thumbnail-sizes.stories.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["thumbnail-sizes.stories.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { html, TemplateResult } from '@spectrum-web-components/base';\n\nimport '@spectrum-web-components/thumbnail/sp-thumbnail.js';\nimport { thumbnail as image } from './images.js';\n\nexport default {\n title: 'Thumbnail/Sizes',\n component: 'sp-thumbnail',\n};\n\nconst thumbnail = ({\n size,\n}: {\n size: 'xxs' | 'xs' | 's' | 'm' | 'l';\n}): TemplateResult => {\n return html`\n <sp-thumbnail size=${size}>\n <img src=${image} alt=\"Woman crouching\" />\n </sp-thumbnail>\n `;\n};\n\nexport const XXS = (): TemplateResult => thumbnail({ size: 'xxs' });\n\nexport const XS = (): TemplateResult => thumbnail({ size: 'xs' });\n\nexport const s = (): TemplateResult => thumbnail({ size: 's' });\n\nexport const m = (): TemplateResult => thumbnail({ size: 'm' });\n\nexport const l = (): TemplateResult => thumbnail({ size: 'l' });\n"],
|
|
5
|
-
"mappings": "AAYA,
|
|
5
|
+
"mappings": ";AAYA,SAAS,YAA4B;AAErC,OAAO;AACP,SAAS,aAAa,aAAa;AAEnC,eAAe;AAAA,EACX,OAAO;AAAA,EACP,WAAW;AACf;AAEA,MAAM,YAAY,CAAC;AAAA,EACf;AACJ,MAEsB;AAClB,SAAO;AAAA,6BACkB;AAAA,uBACN;AAAA;AAAA;AAGvB;AAEO,aAAM,MAAM,MAAsB,UAAU,EAAE,MAAM,MAAM,CAAC;AAE3D,aAAM,KAAK,MAAsB,UAAU,EAAE,MAAM,KAAK,CAAC;AAEzD,aAAM,IAAI,MAAsB,UAAU,EAAE,MAAM,IAAI,CAAC;AAEvD,aAAM,IAAI,MAAsB,UAAU,EAAE,MAAM,IAAI,CAAC;AAEvD,aAAM,IAAI,MAAsB,UAAU,EAAE,MAAM,IAAI,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,40 +1,75 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
import { html } from "@spectrum-web-components/base";
|
|
3
|
+
import "@spectrum-web-components/thumbnail/sp-thumbnail.js";
|
|
4
|
+
import {
|
|
5
|
+
landscape as landscapeImage,
|
|
6
|
+
portrait as portraitImage,
|
|
7
|
+
thumbnail
|
|
8
|
+
} from "./images.js";
|
|
9
|
+
export default {
|
|
10
|
+
title: "Thumbnail",
|
|
11
|
+
component: "sp-thumbnail"
|
|
12
|
+
};
|
|
13
|
+
export const Default = () => {
|
|
14
|
+
return html`
|
|
2
15
|
<sp-thumbnail>
|
|
3
|
-
<img src=${
|
|
16
|
+
<img src=${thumbnail} alt="Woman crouching" />
|
|
4
17
|
</sp-thumbnail>
|
|
5
|
-
|
|
18
|
+
`;
|
|
19
|
+
};
|
|
20
|
+
export const selected = () => {
|
|
21
|
+
return html`
|
|
6
22
|
<sp-thumbnail selected>
|
|
7
|
-
<img src=${
|
|
23
|
+
<img src=${thumbnail} alt="Woman crouching" />
|
|
8
24
|
</sp-thumbnail>
|
|
9
|
-
|
|
25
|
+
`;
|
|
26
|
+
};
|
|
27
|
+
export const focused = () => {
|
|
28
|
+
return html`
|
|
10
29
|
<sp-thumbnail focused>
|
|
11
|
-
<img src=${
|
|
30
|
+
<img src=${thumbnail} alt="Woman crouching" />
|
|
12
31
|
</sp-thumbnail>
|
|
13
|
-
|
|
32
|
+
`;
|
|
33
|
+
};
|
|
34
|
+
export const portrait = () => {
|
|
35
|
+
return html`
|
|
14
36
|
<sp-thumbnail>
|
|
15
|
-
<img src=${
|
|
37
|
+
<img src=${portraitImage} alt="Eiffel Tower at night" />
|
|
16
38
|
</sp-thumbnail>
|
|
17
|
-
|
|
39
|
+
`;
|
|
40
|
+
};
|
|
41
|
+
export const landscape = () => {
|
|
42
|
+
return html`
|
|
18
43
|
<sp-thumbnail>
|
|
19
44
|
<img
|
|
20
|
-
src=${
|
|
45
|
+
src=${landscapeImage}
|
|
21
46
|
alt="Landscape with mountains and lake"
|
|
22
47
|
/>
|
|
23
48
|
</sp-thumbnail>
|
|
24
|
-
|
|
49
|
+
`;
|
|
50
|
+
};
|
|
51
|
+
export const portraitCover = () => {
|
|
52
|
+
return html`
|
|
25
53
|
<sp-thumbnail cover>
|
|
26
|
-
<img src=${
|
|
54
|
+
<img src=${portraitImage} alt="Eiffel Tower at night" />
|
|
27
55
|
</sp-thumbnail>
|
|
28
|
-
|
|
56
|
+
`;
|
|
57
|
+
};
|
|
58
|
+
export const landscapeCover = () => {
|
|
59
|
+
return html`
|
|
29
60
|
<sp-thumbnail cover>
|
|
30
61
|
<img
|
|
31
|
-
src=${
|
|
62
|
+
src=${landscapeImage}
|
|
32
63
|
alt="Landscape with mountains and lake"
|
|
33
64
|
/>
|
|
34
65
|
</sp-thumbnail>
|
|
35
|
-
|
|
66
|
+
`;
|
|
67
|
+
};
|
|
68
|
+
export const background = () => {
|
|
69
|
+
return html`
|
|
36
70
|
<sp-thumbnail background="orange">
|
|
37
|
-
<img src=${
|
|
71
|
+
<img src=${thumbnail} alt="Woman crouching" />
|
|
38
72
|
</sp-thumbnail>
|
|
39
73
|
`;
|
|
74
|
+
};
|
|
40
75
|
//# sourceMappingURL=thumbnail.stories.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["thumbnail.stories.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { html, TemplateResult } from '@spectrum-web-components/base';\n\nimport '@spectrum-web-components/thumbnail/sp-thumbnail.js';\nimport {\n landscape as landscapeImage,\n portrait as portraitImage,\n thumbnail,\n} from './images.js';\n\nexport default {\n title: 'Thumbnail',\n component: 'sp-thumbnail',\n};\n\nexport const Default = (): TemplateResult => {\n return html`\n <sp-thumbnail>\n <img src=${thumbnail} alt=\"Woman crouching\" />\n </sp-thumbnail>\n `;\n};\n\nexport const selected = (): TemplateResult => {\n return html`\n <sp-thumbnail selected>\n <img src=${thumbnail} alt=\"Woman crouching\" />\n </sp-thumbnail>\n `;\n};\n\nexport const focused = (): TemplateResult => {\n return html`\n <sp-thumbnail focused>\n <img src=${thumbnail} alt=\"Woman crouching\" />\n </sp-thumbnail>\n `;\n};\n\nexport const portrait = (): TemplateResult => {\n return html`\n <sp-thumbnail>\n <img src=${portraitImage} alt=\"Eiffel Tower at night\" />\n </sp-thumbnail>\n `;\n};\n\nexport const landscape = (): TemplateResult => {\n return html`\n <sp-thumbnail>\n <img\n src=${landscapeImage}\n alt=\"Landscape with mountains and lake\"\n />\n </sp-thumbnail>\n `;\n};\n\nexport const portraitCover = (): TemplateResult => {\n return html`\n <sp-thumbnail cover>\n <img src=${portraitImage} alt=\"Eiffel Tower at night\" />\n </sp-thumbnail>\n `;\n};\n\nexport const landscapeCover = (): TemplateResult => {\n return html`\n <sp-thumbnail cover>\n <img\n src=${landscapeImage}\n alt=\"Landscape with mountains and lake\"\n />\n </sp-thumbnail>\n `;\n};\n\nexport const background = (): TemplateResult => {\n return html`\n <sp-thumbnail background=\"orange\">\n <img src=${thumbnail} alt=\"Woman crouching\" />\n </sp-thumbnail>\n `;\n};\n"],
|
|
5
|
-
"mappings": "AAYA,
|
|
5
|
+
"mappings": ";AAYA,SAAS,YAA4B;AAErC,OAAO;AACP;AAAA,EACI,aAAa;AAAA,EACb,YAAY;AAAA,EACZ;AAAA,OACG;AAEP,eAAe;AAAA,EACX,OAAO;AAAA,EACP,WAAW;AACf;AAEO,aAAM,UAAU,MAAsB;AACzC,SAAO;AAAA;AAAA,uBAEY;AAAA;AAAA;AAGvB;AAEO,aAAM,WAAW,MAAsB;AAC1C,SAAO;AAAA;AAAA,uBAEY;AAAA;AAAA;AAGvB;AAEO,aAAM,UAAU,MAAsB;AACzC,SAAO;AAAA;AAAA,uBAEY;AAAA;AAAA;AAGvB;AAEO,aAAM,WAAW,MAAsB;AAC1C,SAAO;AAAA;AAAA,uBAEY;AAAA;AAAA;AAGvB;AAEO,aAAM,YAAY,MAAsB;AAC3C,SAAO;AAAA;AAAA;AAAA,sBAGW;AAAA;AAAA;AAAA;AAAA;AAKtB;AAEO,aAAM,gBAAgB,MAAsB;AAC/C,SAAO;AAAA;AAAA,uBAEY;AAAA;AAAA;AAGvB;AAEO,aAAM,iBAAiB,MAAsB;AAChD,SAAO;AAAA;AAAA;AAAA,sBAGW;AAAA;AAAA;AAAA;AAAA;AAKtB;AAEO,aAAM,aAAa,MAAsB;AAC5C,SAAO;AAAA;AAAA,uBAEY;AAAA;AAAA;AAGvB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
import "@spectrum-web-components/thumbnail/sp-thumbnail.js";
|
|
3
|
+
import { html } from "lit";
|
|
4
|
+
import { measureFixtureCreation } from "../../../../test/benchmark/helpers.js";
|
|
5
|
+
import { thumbnail } from "../../stories/images.js";
|
|
6
|
+
measureFixtureCreation(html`
|
|
2
7
|
<sp-thumbnail>
|
|
3
|
-
<img src=${
|
|
8
|
+
<img src=${thumbnail} alt="Woman crouching" />
|
|
4
9
|
</sp-thumbnail>
|
|
5
10
|
`);
|
|
6
11
|
//# sourceMappingURL=basic-test.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["basic-test.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport '@spectrum-web-components/thumbnail/sp-thumbnail.js';\nimport { html } from 'lit';\nimport { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';\nimport { thumbnail } from '../../stories/images.js';\n\nmeasureFixtureCreation(html`\n <sp-thumbnail>\n <img src=${thumbnail} alt=\"Woman crouching\" />\n </sp-thumbnail>\n`);\n"],
|
|
5
|
-
"mappings": "AAYA,
|
|
5
|
+
"mappings": ";AAYA,OAAO;AACP,SAAS,YAAY;AACrB,SAAS,8BAA8B;AACvC,SAAS,iBAAiB;AAE1B,uBAAuB;AAAA;AAAA,mBAEJ;AAAA;AAAA,CAElB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
import * as stories from "../stories/thumbnail-sizes.stories.js";
|
|
3
|
+
import { regressVisuals } from "../../../test/visual/test.js";
|
|
4
|
+
regressVisuals("ThumbnailSizesStories", stories);
|
|
2
5
|
//# sourceMappingURL=thumbnail-sizes.test-vrt.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["thumbnail-sizes.test-vrt.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport * as stories from '../stories/thumbnail-sizes.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('ThumbnailSizesStories', stories);\n"],
|
|
5
|
-
"mappings": "AAYA,
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport * as stories from '../stories/thumbnail-sizes.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\nimport type { TestsType } from '../../../test/visual/test.js';\n\nregressVisuals('ThumbnailSizesStories', stories as unknown as TestsType);\n"],
|
|
5
|
+
"mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAG/B,eAAe,yBAAyB,OAA+B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
import * as stories from "../stories/thumbnail.stories.js";
|
|
3
|
+
import { regressVisuals } from "../../../test/visual/test.js";
|
|
4
|
+
regressVisuals("ThumbnailStories", stories);
|
|
2
5
|
//# sourceMappingURL=thumbnail.test-vrt.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["thumbnail.test-vrt.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport * as stories from '../stories/thumbnail.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('ThumbnailStories', stories);\n"],
|
|
5
|
-
"mappings": "AAYA,
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport * as stories from '../stories/thumbnail.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\nimport type { TestsType } from '../../../test/visual/test.js';\n\nregressVisuals('ThumbnailStories', stories as unknown as TestsType);\n"],
|
|
5
|
+
"mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAG/B,eAAe,oBAAoB,OAA+B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/test/thumbnail.test.js
CHANGED
|
@@ -1,18 +1,50 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
import { elementUpdated, expect, fixture, html } from "@open-wc/testing";
|
|
3
|
+
import "../sp-thumbnail.js";
|
|
4
|
+
import { thumbnail } from "../stories/images.js";
|
|
5
|
+
import { testForLitDevWarnings } from "../../../test/testing-helpers.js";
|
|
6
|
+
describe("Thumbnail", () => {
|
|
7
|
+
testForLitDevWarnings(
|
|
8
|
+
async () => await fixture(
|
|
9
|
+
html`
|
|
2
10
|
<sp-thumbnail>
|
|
3
|
-
<img src=${
|
|
11
|
+
<img src=${thumbnail} alt="Woman crouching" />
|
|
4
12
|
</sp-thumbnail>
|
|
5
|
-
`
|
|
13
|
+
`
|
|
14
|
+
)
|
|
15
|
+
);
|
|
16
|
+
it("loads default thumbnail accessibly", async () => {
|
|
17
|
+
const el = await fixture(
|
|
18
|
+
html`
|
|
6
19
|
<sp-thumbnail>
|
|
7
|
-
<img src=${
|
|
20
|
+
<img src=${thumbnail} alt="Woman crouching" />
|
|
8
21
|
</sp-thumbnail>
|
|
9
|
-
`
|
|
22
|
+
`
|
|
23
|
+
);
|
|
24
|
+
await elementUpdated(el);
|
|
25
|
+
await expect(el).to.be.accessible();
|
|
26
|
+
});
|
|
27
|
+
it("can be size `xxs`", async () => {
|
|
28
|
+
const el = await fixture(
|
|
29
|
+
html`
|
|
10
30
|
<sp-thumbnail size="xxs">
|
|
11
|
-
<img src=${
|
|
31
|
+
<img src=${thumbnail} alt="Woman crouching" />
|
|
12
32
|
</sp-thumbnail>
|
|
13
|
-
`
|
|
33
|
+
`
|
|
34
|
+
);
|
|
35
|
+
await elementUpdated(el);
|
|
36
|
+
expect(el.size).to.equal("xxs");
|
|
37
|
+
});
|
|
38
|
+
it("accepts `background`", async () => {
|
|
39
|
+
const el = await fixture(
|
|
40
|
+
html`
|
|
14
41
|
<sp-thumbnail background="blue">
|
|
15
|
-
<img src=${
|
|
42
|
+
<img src=${thumbnail} alt="Woman crouching" />
|
|
16
43
|
</sp-thumbnail>
|
|
17
|
-
`
|
|
44
|
+
`
|
|
45
|
+
);
|
|
46
|
+
const background = el.shadowRoot.querySelector(".background");
|
|
47
|
+
expect(background).to.not.be.null;
|
|
48
|
+
});
|
|
49
|
+
});
|
|
18
50
|
//# sourceMappingURL=thumbnail.test.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["thumbnail.test.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { elementUpdated, expect, fixture, html } from '@open-wc/testing';\n\nimport '../sp-thumbnail.js';\nimport { Thumbnail } from '..';\nimport { thumbnail } from '../stories/images.js';\nimport { testForLitDevWarnings } from '../../../test/testing-helpers.js';\n\ndescribe('Thumbnail', () => {\n testForLitDevWarnings(\n async () =>\n await fixture<Thumbnail>(\n html`\n <sp-thumbnail>\n <img src=${thumbnail} alt=\"Woman crouching\" />\n </sp-thumbnail>\n `\n )\n );\n it('loads default thumbnail accessibly', async () => {\n const el = await fixture<Thumbnail>(\n html`\n <sp-thumbnail>\n <img src=${thumbnail} alt=\"Woman crouching\" />\n </sp-thumbnail>\n `\n );\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n it('can be size `xxs`', async () => {\n const el = await fixture<Thumbnail>(\n html`\n <sp-thumbnail size=\"xxs\">\n <img src=${thumbnail} alt=\"Woman crouching\" />\n </sp-thumbnail>\n `\n );\n\n await elementUpdated(el);\n\n expect(el.size).to.equal('xxs');\n });\n it('accepts `background`', async () => {\n const el = await fixture<Thumbnail>(\n html`\n <sp-thumbnail background=\"blue\">\n <img src=${thumbnail} alt=\"Woman crouching\" />\n </sp-thumbnail>\n `\n );\n\n const background = el.shadowRoot.querySelector('.background');\n expect(background).to.not.be.null;\n });\n});\n"],
|
|
5
|
-
"mappings": "AAYA,
|
|
5
|
+
"mappings": ";AAYA,SAAS,gBAAgB,QAAQ,SAAS,YAAY;AAEtD,OAAO;AAEP,SAAS,iBAAiB;AAC1B,SAAS,6BAA6B;AAEtC,SAAS,aAAa,MAAM;AACxB;AAAA,IACI,YACI,MAAM;AAAA,MACF;AAAA;AAAA,mCAEmB;AAAA;AAAA;AAAA,IAGvB;AAAA,EACR;AACA,KAAG,sCAAsC,YAAY;AACjD,UAAM,KAAK,MAAM;AAAA,MACb;AAAA;AAAA,+BAEmB;AAAA;AAAA;AAAA,IAGvB;AAEA,UAAM,eAAe,EAAE;AAEvB,UAAM,OAAO,EAAE,EAAE,GAAG,GAAG,WAAW;AAAA,EACtC,CAAC;AACD,KAAG,qBAAqB,YAAY;AAChC,UAAM,KAAK,MAAM;AAAA,MACb;AAAA;AAAA,+BAEmB;AAAA;AAAA;AAAA,IAGvB;AAEA,UAAM,eAAe,EAAE;AAEvB,WAAO,GAAG,IAAI,EAAE,GAAG,MAAM,KAAK;AAAA,EAClC,CAAC;AACD,KAAG,wBAAwB,YAAY;AACnC,UAAM,KAAK,MAAM;AAAA,MACb;AAAA;AAAA,+BAEmB;AAAA;AAAA;AAAA,IAGvB;AAEA,UAAM,aAAa,GAAG,WAAW,cAAc,aAAa;AAC5D,WAAO,UAAU,EAAE,GAAG,IAAI,GAAG;AAAA,EACjC,CAAC;AACL,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|