@spectrum-web-components/progress-bar 0.5.13 → 0.5.14-devmode.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,69 +1,58 @@
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 { elementUpdated, expect, fixture, html } from '@open-wc/testing';
13
- import '../sp-progress-bar.js';
14
- describe('ProgressBar', () => {
15
- it('loads default progress-bar accessibly', async () => {
16
- const el = await fixture(html `
1
+ import { elementUpdated, expect, fixture, html } from "@open-wc/testing";
2
+ import "@spectrum-web-components/progress-bar/sp-progress-bar.js";
3
+ describe("ProgressBar", () => {
4
+ it("loads default progress-bar accessibly", async () => {
5
+ const el = await fixture(html`
17
6
  <sp-progress-bar label="Loading"></sp-progress-bar>
18
7
  `);
19
- await elementUpdated(el);
20
- expect(el).to.not.be.undefined;
21
- await expect(el).to.be.accessible();
22
- });
23
- it('accepts a changing progress', async () => {
24
- const el = await fixture(html `
8
+ await elementUpdated(el);
9
+ expect(el).to.not.be.undefined;
10
+ await expect(el).to.be.accessible();
11
+ });
12
+ it("accepts a changing progress", async () => {
13
+ const el = await fixture(html`
25
14
  <sp-progress-bar label="Changing value"></sp-progress-bar>
26
15
  `);
27
- await elementUpdated(el);
28
- expect(el.hasAttribute('aria-valuenow')).to.be.true;
29
- expect(el.getAttribute('aria-valuenow')).to.equal('0');
30
- el.progress = 50;
31
- await elementUpdated(el);
32
- expect(el.hasAttribute('aria-valuenow')).to.be.true;
33
- expect(el.getAttribute('aria-valuenow')).to.equal('50');
34
- el.progress = 100;
35
- await elementUpdated(el);
36
- expect(el.hasAttribute('aria-valuenow')).to.be.true;
37
- expect(el.getAttribute('aria-valuenow')).to.equal('100');
38
- });
39
- it('loads - [indeterminate]', async () => {
40
- const el = await fixture(html `
16
+ await elementUpdated(el);
17
+ expect(el.hasAttribute("aria-valuenow")).to.be.true;
18
+ expect(el.getAttribute("aria-valuenow")).to.equal("0");
19
+ el.progress = 50;
20
+ await elementUpdated(el);
21
+ expect(el.hasAttribute("aria-valuenow")).to.be.true;
22
+ expect(el.getAttribute("aria-valuenow")).to.equal("50");
23
+ el.progress = 100;
24
+ await elementUpdated(el);
25
+ expect(el.hasAttribute("aria-valuenow")).to.be.true;
26
+ expect(el.getAttribute("aria-valuenow")).to.equal("100");
27
+ });
28
+ it("loads - [indeterminate]", async () => {
29
+ const el = await fixture(html`
41
30
  <sp-progress-bar indeterminate label="Loading"></sp-progress-bar>
42
31
  `);
43
- await elementUpdated(el);
44
- expect(el).to.not.be.undefined;
45
- await expect(el).to.be.accessible();
46
- });
47
- it('accepts user `role`', async () => {
48
- const el = await fixture(html `
32
+ await elementUpdated(el);
33
+ expect(el).to.not.be.undefined;
34
+ await expect(el).to.be.accessible();
35
+ });
36
+ it("accepts user `role`", async () => {
37
+ const el = await fixture(html`
49
38
  <sp-progress-bar role="progressbar"></sp-progress-bar>
50
39
  `);
51
- await elementUpdated(el);
52
- expect(el.getAttribute('role')).to.equal('progressbar');
53
- });
54
- it('returns to indeterminate', async () => {
55
- const el = await fixture(html `
40
+ await elementUpdated(el);
41
+ expect(el.getAttribute("role")).to.equal("progressbar");
42
+ });
43
+ it("returns to indeterminate", async () => {
44
+ const el = await fixture(html`
56
45
  <sp-progress-bar
57
46
  progress="50"
58
47
  label="Sometimes indeterminate"
59
48
  ></sp-progress-bar>
60
49
  `);
61
- await elementUpdated(el);
62
- expect(el.hasAttribute('aria-valuenow')).to.be.true;
63
- expect(el.getAttribute('aria-valuenow')).to.equal('50');
64
- el.indeterminate = true;
65
- await elementUpdated(el);
66
- expect(el.hasAttribute('aria-valuenow')).to.be.false;
67
- });
50
+ await elementUpdated(el);
51
+ expect(el.hasAttribute("aria-valuenow")).to.be.true;
52
+ expect(el.getAttribute("aria-valuenow")).to.equal("50");
53
+ el.indeterminate = true;
54
+ await elementUpdated(el);
55
+ expect(el.hasAttribute("aria-valuenow")).to.be.false;
56
+ });
68
57
  });
69
- //# sourceMappingURL=progress-bar.test.js.map
58
+ //# sourceMappingURL=progress-bar.test.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"progress-bar.test.js","sourceRoot":"","sources":["progress-bar.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAEzE,OAAO,uBAAuB,CAAC;AAG/B,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IACzB,EAAE,CAAC,uCAAuC,EAAE,KAAK,IAAI,EAAE;QACnD,MAAM,EAAE,GAAG,MAAM,OAAO,CACpB,IAAI,CAAA;;aAEH,CACJ,CAAC;QAEF,MAAM,cAAc,CAAC,EAAE,CAAC,CAAC;QACzB,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,SAAS,CAAC;QAE/B,MAAM,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC;IACxC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6BAA6B,EAAE,KAAK,IAAI,EAAE;QACzC,MAAM,EAAE,GAAG,MAAM,OAAO,CAAc,IAAI,CAAA;;SAEzC,CAAC,CAAC;QAEH,MAAM,cAAc,CAAC,EAAE,CAAC,CAAC;QAEzB,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;QACpD,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC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C,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,0BAA0B,EAAE,KAAK,IAAI,EAAE;QACtC,MAAM,EAAE,GAAG,MAAM,OAAO,CAAc,IAAI,CAAA;;;;;SAKzC,CAAC,CAAC;QAEH,MAAM,cAAc,CAAC,EAAE,CAAC,CAAC;QAEzB,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;QACpD,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAExD,EAAE,CAAC,aAAa,GAAG,IAAI,CAAC;QAExB,MAAM,cAAc,CAAC,EAAE,CAAC,CAAC;QAEzB,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;IACzD,CAAC,CAAC,CAAC;AACP,CAAC,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 { elementUpdated, expect, fixture, html } from '@open-wc/testing';\n\nimport '../sp-progress-bar.js';\nimport { ProgressBar } from '..';\n\ndescribe('ProgressBar', () => {\n it('loads default progress-bar accessibly', async () => {\n const el = await fixture<ProgressBar>(\n html`\n <sp-progress-bar label=\"Loading\"></sp-progress-bar>\n `\n );\n\n await elementUpdated(el);\n expect(el).to.not.be.undefined;\n\n await expect(el).to.be.accessible();\n });\n\n it('accepts a changing progress', async () => {\n const el = await fixture<ProgressBar>(html`\n <sp-progress-bar label=\"Changing value\"></sp-progress-bar>\n `);\n\n await elementUpdated(el);\n\n expect(el.hasAttribute('aria-valuenow')).to.be.true;\n expect(el.getAttribute('aria-valuenow')).to.equal('0');\n\n el.progress = 50;\n\n await elementUpdated(el);\n\n expect(el.hasAttribute('aria-valuenow')).to.be.true;\n expect(el.getAttribute('aria-valuenow')).to.equal('50');\n\n el.progress = 100;\n\n await elementUpdated(el);\n\n expect(el.hasAttribute('aria-valuenow')).to.be.true;\n expect(el.getAttribute('aria-valuenow')).to.equal('100');\n });\n it('loads - [indeterminate]', async () => {\n const el = await fixture<ProgressBar>(html`\n <sp-progress-bar indeterminate label=\"Loading\"></sp-progress-bar>\n `);\n\n await elementUpdated(el);\n expect(el).to.not.be.undefined;\n\n await expect(el).to.be.accessible();\n });\n it('accepts user `role`', async () => {\n const el = await fixture<ProgressBar>(html`\n <sp-progress-bar role=\"progressbar\"></sp-progress-bar>\n `);\n\n await elementUpdated(el);\n\n expect(el.getAttribute('role')).to.equal('progressbar');\n });\n it('returns to indeterminate', async () => {\n const el = await fixture<ProgressBar>(html`\n <sp-progress-bar\n progress=\"50\"\n label=\"Sometimes indeterminate\"\n ></sp-progress-bar>\n `);\n\n await elementUpdated(el);\n\n expect(el.hasAttribute('aria-valuenow')).to.be.true;\n expect(el.getAttribute('aria-valuenow')).to.equal('50');\n\n el.indeterminate = true;\n\n await elementUpdated(el);\n\n expect(el.hasAttribute('aria-valuenow')).to.be.false;\n });\n});\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["progress-bar.test.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 { elementUpdated, expect, fixture, html } from '@open-wc/testing';\n\nimport '@spectrum-web-components/progress-bar/sp-progress-bar.js';\nimport { ProgressBar } from '@spectrum-web-components/progress-bar';\n\ndescribe('ProgressBar', () => {\n it('loads default progress-bar accessibly', async () => {\n const el = await fixture<ProgressBar>(\n html`\n <sp-progress-bar label=\"Loading\"></sp-progress-bar>\n `\n );\n\n await elementUpdated(el);\n expect(el).to.not.be.undefined;\n\n await expect(el).to.be.accessible();\n });\n\n it('accepts a changing progress', async () => {\n const el = await fixture<ProgressBar>(html`\n <sp-progress-bar label=\"Changing value\"></sp-progress-bar>\n `);\n\n await elementUpdated(el);\n\n expect(el.hasAttribute('aria-valuenow')).to.be.true;\n expect(el.getAttribute('aria-valuenow')).to.equal('0');\n\n el.progress = 50;\n\n await elementUpdated(el);\n\n expect(el.hasAttribute('aria-valuenow')).to.be.true;\n expect(el.getAttribute('aria-valuenow')).to.equal('50');\n\n el.progress = 100;\n\n await elementUpdated(el);\n\n expect(el.hasAttribute('aria-valuenow')).to.be.true;\n expect(el.getAttribute('aria-valuenow')).to.equal('100');\n });\n it('loads - [indeterminate]', async () => {\n const el = await fixture<ProgressBar>(html`\n <sp-progress-bar indeterminate label=\"Loading\"></sp-progress-bar>\n `);\n\n await elementUpdated(el);\n expect(el).to.not.be.undefined;\n\n await expect(el).to.be.accessible();\n });\n it('accepts user `role`', async () => {\n const el = await fixture<ProgressBar>(html`\n <sp-progress-bar role=\"progressbar\"></sp-progress-bar>\n `);\n\n await elementUpdated(el);\n\n expect(el.getAttribute('role')).to.equal('progressbar');\n });\n it('returns to indeterminate', async () => {\n const el = await fixture<ProgressBar>(html`\n <sp-progress-bar\n progress=\"50\"\n label=\"Sometimes indeterminate\"\n ></sp-progress-bar>\n `);\n\n await elementUpdated(el);\n\n expect(el.hasAttribute('aria-valuenow')).to.be.true;\n expect(el.getAttribute('aria-valuenow')).to.equal('50');\n\n el.indeterminate = true;\n\n await elementUpdated(el);\n\n expect(el.hasAttribute('aria-valuenow')).to.be.false;\n });\n});\n"],
5
+ "mappings": "AAYA;AAEA;AAGA,SAAS,eAAe,MAAM;AAC1B,KAAG,yCAAyC,YAAY;AACpD,UAAM,KAAK,MAAM,QACb;AAAA;AAAA,aAGJ;AAEA,UAAM,eAAe,EAAE;AACvB,WAAO,EAAE,EAAE,GAAG,IAAI,GAAG;AAErB,UAAM,OAAO,EAAE,EAAE,GAAG,GAAG,WAAW;AAAA,EACtC,CAAC;AAED,KAAG,+BAA+B,YAAY;AAC1C,UAAM,KAAK,MAAM,QAAqB;AAAA;AAAA,SAErC;AAED,UAAM,eAAe,EAAE;AAEvB,WAAO,GAAG,aAAa,eAAe,CAAC,EAAE,GAAG,GAAG;AAC/C,WAAO,GAAG,aAAa,eAAe,CAAC,EAAE,GAAG,MAAM,GAAG;AAErD,OAAG,WAAW;AAEd,UAAM,eAAe,EAAE;AAEvB,WAAO,GAAG,aAAa,eAAe,CAAC,EAAE,GAAG,GAAG;AAC/C,WAAO,GAAG,aAAa,eAAe,CAAC,EAAE,GAAG,MAAM,IAAI;AAEtD,OAAG,WAAW;AAEd,UAAM,eAAe,EAAE;AAEvB,WAAO,GAAG,aAAa,eAAe,CAAC,EAAE,GAAG,GAAG;AAC/C,WAAO,GAAG,aAAa,eAAe,CAAC,EAAE,GAAG,MAAM,KAAK;AAAA,EAC3D,CAAC;AACD,KAAG,2BAA2B,YAAY;AACtC,UAAM,KAAK,MAAM,QAAqB;AAAA;AAAA,SAErC;AAED,UAAM,eAAe,EAAE;AACvB,WAAO,EAAE,EAAE,GAAG,IAAI,GAAG;AAErB,UAAM,OAAO,EAAE,EAAE,GAAG,GAAG,WAAW;AAAA,EACtC,CAAC;AACD,KAAG,uBAAuB,YAAY;AAClC,UAAM,KAAK,MAAM,QAAqB;AAAA;AAAA,SAErC;AAED,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