@spectrum-web-components/link 0.11.5-express.9 → 0.12.0
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 +5 -5
- package/stories/link-sizes.stories.js +0 -30
- package/stories/link-sizes.stories.js.map +0 -1
- package/stories/link.stories.js +0 -83
- package/stories/link.stories.js.map +0 -1
- package/test/link-sizes.test-vrt.js +0 -15
- package/test/link-sizes.test-vrt.js.map +0 -1
- package/test/link.test-vrt.js +0 -15
- package/test/link.test-vrt.js.map +0 -1
- package/test/link.test.js +0 -65
- package/test/link.test.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/link",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -44,17 +44,17 @@
|
|
|
44
44
|
"lit-html"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@spectrum-web-components/base": "^0.5.
|
|
48
|
-
"@spectrum-web-components/shared": "^0.13.
|
|
47
|
+
"@spectrum-web-components/base": "^0.5.3",
|
|
48
|
+
"@spectrum-web-components/shared": "^0.13.5",
|
|
49
49
|
"tslib": "^2.0.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@spectrum-css/link": "^3.1.
|
|
52
|
+
"@spectrum-css/link": "^3.1.15"
|
|
53
53
|
},
|
|
54
54
|
"types": "./src/index.d.ts",
|
|
55
55
|
"customElements": "custom-elements.json",
|
|
56
56
|
"sideEffects": [
|
|
57
57
|
"./sp-*.js"
|
|
58
58
|
],
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "57aba8030b6af96af4015a0aa830e342a17dc219"
|
|
60
60
|
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020 Adobe. All rights reserved.
|
|
3
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
import { html } from '@spectrum-web-components/base';
|
|
13
|
-
import '../sp-link.js';
|
|
14
|
-
export default {
|
|
15
|
-
component: 'sp-link',
|
|
16
|
-
title: 'Link/Sizes',
|
|
17
|
-
};
|
|
18
|
-
export const s = () => html `
|
|
19
|
-
<sp-link size="s" href="#">small link</sp-link>
|
|
20
|
-
`;
|
|
21
|
-
export const m = () => html `
|
|
22
|
-
<sp-link size="m" href="#">medium link</sp-link>
|
|
23
|
-
`;
|
|
24
|
-
export const L = () => html `
|
|
25
|
-
<sp-link size="l" href="#">large link</sp-link>
|
|
26
|
-
`;
|
|
27
|
-
export const XL = () => html `
|
|
28
|
-
<sp-link size="xl" href="#">extra large link</sp-link>
|
|
29
|
-
`;
|
|
30
|
-
//# sourceMappingURL=link-sizes.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"link-sizes.stories.js","sourceRoot":"","sources":["link-sizes.stories.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,IAAI,EAAkB,MAAM,+BAA+B,CAAC;AAErE,OAAO,eAAe,CAAC;AAEvB,eAAe;IACX,SAAS,EAAE,SAAS;IACpB,KAAK,EAAE,YAAY;CACtB,CAAC;AAEF,MAAM,CAAC,MAAM,CAAC,GAAG,GAAmB,EAAE,CAAC,IAAI,CAAA;;CAE1C,CAAC;AAEF,MAAM,CAAC,MAAM,CAAC,GAAG,GAAmB,EAAE,CAAC,IAAI,CAAA;;CAE1C,CAAC;AAEF,MAAM,CAAC,MAAM,CAAC,GAAG,GAAmB,EAAE,CAAC,IAAI,CAAA;;CAE1C,CAAC;AAEF,MAAM,CAAC,MAAM,EAAE,GAAG,GAAmB,EAAE,CAAC,IAAI,CAAA;;CAE3C,CAAC","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*/\nimport { html, TemplateResult } from '@spectrum-web-components/base';\n\nimport '../sp-link.js';\n\nexport default {\n component: 'sp-link',\n title: 'Link/Sizes',\n};\n\nexport const s = (): TemplateResult => html`\n <sp-link size=\"s\" href=\"#\">small link</sp-link>\n`;\n\nexport const m = (): TemplateResult => html`\n <sp-link size=\"m\" href=\"#\">medium link</sp-link>\n`;\n\nexport const L = (): TemplateResult => html`\n <sp-link size=\"l\" href=\"#\">large link</sp-link>\n`;\n\nexport const XL = (): TemplateResult => html`\n <sp-link size=\"xl\" href=\"#\">extra large link</sp-link>\n`;\n"]}
|
package/stories/link.stories.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020 Adobe. All rights reserved.
|
|
3
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
import { html } from '@spectrum-web-components/base';
|
|
13
|
-
import '../sp-link.js';
|
|
14
|
-
export default {
|
|
15
|
-
component: 'sp-link',
|
|
16
|
-
title: 'Link',
|
|
17
|
-
};
|
|
18
|
-
export const Default = () => {
|
|
19
|
-
// prettier-ignore
|
|
20
|
-
return html `
|
|
21
|
-
This is a <sp-link href="#">link</sp-link> in a sentence.
|
|
22
|
-
`;
|
|
23
|
-
};
|
|
24
|
-
export const Quiet = () => {
|
|
25
|
-
// prettier-ignore
|
|
26
|
-
return html `
|
|
27
|
-
This is a <sp-link quiet href="#">quiet link</sp-link> in a sentence.
|
|
28
|
-
`;
|
|
29
|
-
};
|
|
30
|
-
export const secondary = () => {
|
|
31
|
-
// prettier-ignore
|
|
32
|
-
return html `
|
|
33
|
-
This is a <sp-link variant="secondary" href="#">link</sp-link> in a sentence.
|
|
34
|
-
`;
|
|
35
|
-
};
|
|
36
|
-
export const secondaryQuiet = () => {
|
|
37
|
-
// prettier-ignore
|
|
38
|
-
return html `
|
|
39
|
-
This is a <sp-link variant="secondary" quiet href="#">quiet link</sp-link> in a sentence.
|
|
40
|
-
`;
|
|
41
|
-
};
|
|
42
|
-
export const overBackground = () => {
|
|
43
|
-
return html `
|
|
44
|
-
<div
|
|
45
|
-
style="background-color: rgb(15, 121, 125); padding: 15px 20px; display: inline-block;"
|
|
46
|
-
>
|
|
47
|
-
<p style="color: rgb(240, 240, 240);">
|
|
48
|
-
This
|
|
49
|
-
<sp-link over-background href="#">link</sp-link>
|
|
50
|
-
has a background.
|
|
51
|
-
</p>
|
|
52
|
-
</div>
|
|
53
|
-
`;
|
|
54
|
-
};
|
|
55
|
-
export const overBackgroundQuiet = () => {
|
|
56
|
-
return html `
|
|
57
|
-
<div
|
|
58
|
-
style="background-color: rgb(15, 121, 125); padding: 15px 20px; display: inline-block;"
|
|
59
|
-
>
|
|
60
|
-
<p style="color: rgb(240, 240, 240);">
|
|
61
|
-
This
|
|
62
|
-
<sp-link over-background quiet href="#">link</sp-link>
|
|
63
|
-
has a background.
|
|
64
|
-
</p>
|
|
65
|
-
</div>
|
|
66
|
-
`;
|
|
67
|
-
};
|
|
68
|
-
export const Download = () => {
|
|
69
|
-
const blob = new Blob(['some text for the file'], {
|
|
70
|
-
type: 'text/plain;charset=utf-8',
|
|
71
|
-
});
|
|
72
|
-
return html `
|
|
73
|
-
This is a
|
|
74
|
-
<sp-link download="somefile.txt" href="${URL.createObjectURL(blob)}">
|
|
75
|
-
downloadable file
|
|
76
|
-
</sp-link>
|
|
77
|
-
for you to click on.
|
|
78
|
-
`;
|
|
79
|
-
};
|
|
80
|
-
overBackground.story = {
|
|
81
|
-
name: 'Over Background',
|
|
82
|
-
};
|
|
83
|
-
//# sourceMappingURL=link.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"link.stories.js","sourceRoot":"","sources":["link.stories.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,IAAI,EAAkB,MAAM,+BAA+B,CAAC;AAErE,OAAO,eAAe,CAAC;AAEvB,eAAe;IACX,SAAS,EAAE,SAAS;IACpB,KAAK,EAAE,MAAM;CAChB,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,GAAmB,EAAE;IACxC,kBAAkB;IAClB,OAAO,IAAI,CAAA;;KAEV,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,GAAmB,EAAE;IACtC,kBAAkB;IAClB,OAAO,IAAI,CAAA;;KAEV,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,GAAmB,EAAE;IAC1C,kBAAkB;IAClB,OAAO,IAAI,CAAA;;KAEV,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,GAAmB,EAAE;IAC/C,kBAAkB;IAClB,OAAO,IAAI,CAAA;;KAEV,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,GAAmB,EAAE;IAC/C,OAAO,IAAI,CAAA;;;;;;;;;;KAUV,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAmB,EAAE;IACpD,OAAO,IAAI,CAAA;;;;;;;;;;KAUV,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAmB,EAAE;IACzC,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,wBAAwB,CAAC,EAAE;QAC9C,IAAI,EAAE,0BAA0B;KACnC,CAAC,CAAC;IACH,OAAO,IAAI,CAAA;;iDAEkC,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC;;;;KAIrE,CAAC;AACN,CAAC,CAAC;AAEF,cAAc,CAAC,KAAK,GAAG;IACnB,IAAI,EAAE,iBAAiB;CAC1B,CAAC","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*/\nimport { html, TemplateResult } from '@spectrum-web-components/base';\n\nimport '../sp-link.js';\n\nexport default {\n component: 'sp-link',\n title: 'Link',\n};\n\nexport const Default = (): TemplateResult => {\n // prettier-ignore\n return html`\n This is a <sp-link href=\"#\">link</sp-link> in a sentence.\n `;\n};\n\nexport const Quiet = (): TemplateResult => {\n // prettier-ignore\n return html`\n This is a <sp-link quiet href=\"#\">quiet link</sp-link> in a sentence.\n `;\n};\n\nexport const secondary = (): TemplateResult => {\n // prettier-ignore\n return html`\n This is a <sp-link variant=\"secondary\" href=\"#\">link</sp-link> in a sentence.\n `;\n};\n\nexport const secondaryQuiet = (): TemplateResult => {\n // prettier-ignore\n return html`\n This is a <sp-link variant=\"secondary\" quiet href=\"#\">quiet link</sp-link> in a sentence.\n `;\n};\n\nexport const overBackground = (): TemplateResult => {\n return html`\n <div\n style=\"background-color: rgb(15, 121, 125); padding: 15px 20px; display: inline-block;\"\n >\n <p style=\"color: rgb(240, 240, 240);\">\n This\n <sp-link over-background href=\"#\">link</sp-link>\n has a background.\n </p>\n </div>\n `;\n};\n\nexport const overBackgroundQuiet = (): TemplateResult => {\n return html`\n <div\n style=\"background-color: rgb(15, 121, 125); padding: 15px 20px; display: inline-block;\"\n >\n <p style=\"color: rgb(240, 240, 240);\">\n This\n <sp-link over-background quiet href=\"#\">link</sp-link>\n has a background.\n </p>\n </div>\n `;\n};\n\nexport const Download = (): TemplateResult => {\n const blob = new Blob(['some text for the file'], {\n type: 'text/plain;charset=utf-8',\n });\n return html`\n This is a\n <sp-link download=\"somefile.txt\" href=\"${URL.createObjectURL(blob)}\">\n downloadable file\n </sp-link>\n for you to click on.\n `;\n};\n\noverBackground.story = {\n name: 'Over Background',\n};\n"]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020 Adobe. All rights reserved.
|
|
3
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
import * as stories from '../stories/link-sizes.stories.js';
|
|
13
|
-
import { regressVisuals } from '../../../test/visual/test.js';
|
|
14
|
-
regressVisuals('LinkSizesStories', stories);
|
|
15
|
-
//# sourceMappingURL=link-sizes.test-vrt.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"link-sizes.test-vrt.js","sourceRoot":"","sources":["link-sizes.test-vrt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,KAAK,OAAO,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,cAAc,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC","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/link-sizes.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('LinkSizesStories', stories);\n"]}
|
package/test/link.test-vrt.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020 Adobe. All rights reserved.
|
|
3
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
import * as stories from '../stories/link.stories.js';
|
|
13
|
-
import { regressVisuals } from '../../../test/visual/test.js';
|
|
14
|
-
regressVisuals('LinkStories', stories);
|
|
15
|
-
//# sourceMappingURL=link.test-vrt.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"link.test-vrt.js","sourceRoot":"","sources":["link.test-vrt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,cAAc,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC","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/link.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('LinkStories', stories);\n"]}
|
package/test/link.test.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020 Adobe. All rights reserved.
|
|
3
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
import '../sp-link.js';
|
|
13
|
-
import { elementUpdated, expect, fixture, html } from '@open-wc/testing';
|
|
14
|
-
describe('Link', () => {
|
|
15
|
-
it('loads', async () => {
|
|
16
|
-
const el = await fixture(html `
|
|
17
|
-
<sp-link href="test_url">Default Link</sp-link>
|
|
18
|
-
`);
|
|
19
|
-
await elementUpdated(el);
|
|
20
|
-
expect(el).to.not.be.undefined;
|
|
21
|
-
expect(el.textContent).to.include('Default Link');
|
|
22
|
-
await expect(el).to.be.accessible();
|
|
23
|
-
});
|
|
24
|
-
it('loads[download]', async () => {
|
|
25
|
-
const el = await fixture(html `
|
|
26
|
-
<sp-link href="test_url" download="somefile.txt">
|
|
27
|
-
Default Link
|
|
28
|
-
</sp-link>
|
|
29
|
-
`);
|
|
30
|
-
await elementUpdated(el);
|
|
31
|
-
expect(el).to.not.be.undefined;
|
|
32
|
-
expect(el.textContent).to.include('Default Link');
|
|
33
|
-
await expect(el).to.be.accessible();
|
|
34
|
-
});
|
|
35
|
-
it('loads[rel]', async () => {
|
|
36
|
-
const el = await fixture(html `
|
|
37
|
-
<sp-link href="test_url" rel="external">Default Link</sp-link>
|
|
38
|
-
`);
|
|
39
|
-
await elementUpdated(el);
|
|
40
|
-
expect(el).to.not.be.undefined;
|
|
41
|
-
expect(el.focusElement.getAttribute('rel')).to.eq('external');
|
|
42
|
-
await expect(el).to.be.accessible();
|
|
43
|
-
});
|
|
44
|
-
it('manages the `size` atrbute', async () => {
|
|
45
|
-
const el = await fixture(html `
|
|
46
|
-
<sp-link href="test_url">Default Link</sp-link>
|
|
47
|
-
`);
|
|
48
|
-
await elementUpdated(el);
|
|
49
|
-
expect(el.size, 'property 0: m').to.equal('m');
|
|
50
|
-
expect(el.getAttribute('size'), 'attribute 0: null').to.be.null;
|
|
51
|
-
el.setAttribute('size', 'xl');
|
|
52
|
-
await elementUpdated(el);
|
|
53
|
-
expect(el.size, 'property 1: xl').to.equal('xl');
|
|
54
|
-
expect(el.getAttribute('size'), 'attribute 1: xl').to.equal('xl');
|
|
55
|
-
el.removeAttribute('size');
|
|
56
|
-
await elementUpdated(el);
|
|
57
|
-
expect(el.size, 'property 2: m').to.equal('m');
|
|
58
|
-
expect(el.getAttribute('size'), 'attribute 2: null').to.be.null;
|
|
59
|
-
el.setAttribute('size', 'm');
|
|
60
|
-
await elementUpdated(el);
|
|
61
|
-
expect(el.size, 'property 3: m').to.equal('m');
|
|
62
|
-
expect(el.getAttribute('size'), 'attribute 3: m').to.equal('m');
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
//# sourceMappingURL=link.test.js.map
|
package/test/link.test.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"link.test.js","sourceRoot":"","sources":["link.test.ts"],"names":[],"mappings":"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","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 '../sp-link.js';\nimport { Link } from '../';\nimport { elementUpdated, expect, fixture, html } from '@open-wc/testing';\n\ndescribe('Link', () => {\n it('loads', async () => {\n const el = await fixture<Link>(\n html`\n <sp-link href=\"test_url\">Default Link</sp-link>\n `\n );\n\n await elementUpdated(el);\n expect(el).to.not.be.undefined;\n expect(el.textContent).to.include('Default Link');\n\n await expect(el).to.be.accessible();\n });\n\n it('loads[download]', async () => {\n const el = await fixture<Link>(\n html`\n <sp-link href=\"test_url\" download=\"somefile.txt\">\n Default Link\n </sp-link>\n `\n );\n\n await elementUpdated(el);\n expect(el).to.not.be.undefined;\n expect(el.textContent).to.include('Default Link');\n\n await expect(el).to.be.accessible();\n });\n\n it('loads[rel]', async () => {\n const el = await fixture<Link>(\n html`\n <sp-link href=\"test_url\" rel=\"external\">Default Link</sp-link>\n `\n );\n\n await elementUpdated(el);\n expect(el).to.not.be.undefined;\n expect(el.focusElement.getAttribute('rel')).to.eq('external');\n\n await expect(el).to.be.accessible();\n });\n\n it('manages the `size` atrbute', async () => {\n const el = await fixture<Link>(\n html`\n <sp-link href=\"test_url\">Default Link</sp-link>\n `\n );\n\n await elementUpdated(el);\n expect(el.size, 'property 0: m').to.equal('m');\n expect(el.getAttribute('size'), 'attribute 0: null').to.be.null;\n\n el.setAttribute('size', 'xl');\n await elementUpdated(el);\n expect(el.size, 'property 1: xl').to.equal('xl');\n expect(el.getAttribute('size'), 'attribute 1: xl').to.equal('xl');\n\n el.removeAttribute('size');\n await elementUpdated(el);\n expect(el.size, 'property 2: m').to.equal('m');\n expect(el.getAttribute('size'), 'attribute 2: null').to.be.null;\n\n el.setAttribute('size', 'm');\n await elementUpdated(el);\n expect(el.size, 'property 3: m').to.equal('m');\n expect(el.getAttribute('size'), 'attribute 3: m').to.equal('m');\n });\n});\n"]}
|