@spectrum-web-components/underlay 0.42.4 → 0.42.5
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +3 -3
- package/test/underlay.test.js +19 -10
- package/test/underlay.test.js.map +2 -2
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@spectrum-web-components/underlay",
|
3
|
-
"version": "0.42.
|
3
|
+
"version": "0.42.5",
|
4
4
|
"publishConfig": {
|
5
5
|
"access": "public"
|
6
6
|
},
|
@@ -57,7 +57,7 @@
|
|
57
57
|
"lit-html"
|
58
58
|
],
|
59
59
|
"dependencies": {
|
60
|
-
"@spectrum-web-components/base": "^0.42.
|
60
|
+
"@spectrum-web-components/base": "^0.42.5"
|
61
61
|
},
|
62
62
|
"devDependencies": {
|
63
63
|
"@spectrum-css/underlay": "^4.1.0"
|
@@ -68,5 +68,5 @@
|
|
68
68
|
"./sp-*.js",
|
69
69
|
"./**/*.dev.js"
|
70
70
|
],
|
71
|
-
"gitHead": "
|
71
|
+
"gitHead": "f29fd737947945de8cd6f5bc03fb389d386c9c3a"
|
72
72
|
}
|
package/test/underlay.test.js
CHANGED
@@ -2,22 +2,31 @@
|
|
2
2
|
import { elementUpdated, expect, fixture, html } from "@open-wc/testing";
|
3
3
|
import "@spectrum-web-components/underlay/sp-underlay.js";
|
4
4
|
import { testForLitDevWarnings } from "../../../test/testing-helpers.js";
|
5
|
+
import { spy } from "sinon";
|
5
6
|
describe("Underlay", () => {
|
6
7
|
testForLitDevWarnings(
|
7
|
-
async () => await fixture(
|
8
|
-
|
9
|
-
|
10
|
-
`
|
11
|
-
)
|
8
|
+
async () => await fixture(html`
|
9
|
+
<sp-underlay></sp-underlay>
|
10
|
+
`)
|
12
11
|
);
|
13
12
|
it("loads default underlay accessibly", async () => {
|
14
|
-
const el = await fixture(
|
15
|
-
|
16
|
-
|
17
|
-
`
|
18
|
-
);
|
13
|
+
const el = await fixture(html`
|
14
|
+
<sp-underlay></sp-underlay>
|
15
|
+
`);
|
19
16
|
await elementUpdated(el);
|
20
17
|
await expect(el).to.be.accessible();
|
21
18
|
});
|
19
|
+
it("fires a close event when clicked", async () => {
|
20
|
+
const el = await fixture(html`
|
21
|
+
<sp-underlay></sp-underlay>
|
22
|
+
`);
|
23
|
+
await elementUpdated(el);
|
24
|
+
const closeSpy = spy();
|
25
|
+
el.addEventListener("close", () => closeSpy());
|
26
|
+
expect(closeSpy.callCount).to.equal(0);
|
27
|
+
el.dispatchEvent(new PointerEvent("pointerdown", { button: 0 }));
|
28
|
+
el.dispatchEvent(new PointerEvent("pointerup"));
|
29
|
+
expect(closeSpy.callCount).to.equal(1);
|
30
|
+
});
|
22
31
|
});
|
23
32
|
//# sourceMappingURL=underlay.test.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["underlay.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/underlay/sp-underlay.js';\nimport { Underlay } from '@spectrum-web-components/underlay';\nimport { testForLitDevWarnings } from '../../../test/testing-helpers.js';\n\ndescribe('Underlay', () => {\n testForLitDevWarnings(\n async () =>\n await fixture<Underlay>(
|
5
|
-
"mappings": ";AAYA,SAAS,gBAAgB,QAAQ,SAAS,YAAY;AAEtD,OAAO;AAEP,SAAS,6BAA6B;
|
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/underlay/sp-underlay.js';\nimport { Underlay } from '@spectrum-web-components/underlay';\nimport { testForLitDevWarnings } from '../../../test/testing-helpers.js';\nimport { spy } from 'sinon';\n\ndescribe('Underlay', () => {\n testForLitDevWarnings(\n async () =>\n await fixture<Underlay>(html`\n <sp-underlay></sp-underlay>\n `)\n );\n it('loads default underlay accessibly', async () => {\n const el = await fixture<Underlay>(html`\n <sp-underlay></sp-underlay>\n `);\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n\n it('fires a close event when clicked', async () => {\n const el = await fixture<Underlay>(html`\n <sp-underlay></sp-underlay>\n `);\n\n await elementUpdated(el);\n const closeSpy = spy();\n el.addEventListener('close', () => closeSpy());\n expect(closeSpy.callCount).to.equal(0);\n\n el.dispatchEvent(new PointerEvent('pointerdown', { button: 0 }));\n el.dispatchEvent(new PointerEvent('pointerup'));\n\n expect(closeSpy.callCount).to.equal(1);\n });\n});\n"],
|
5
|
+
"mappings": ";AAYA,SAAS,gBAAgB,QAAQ,SAAS,YAAY;AAEtD,OAAO;AAEP,SAAS,6BAA6B;AACtC,SAAS,WAAW;AAEpB,SAAS,YAAY,MAAM;AACvB;AAAA,IACI,YACI,MAAM,QAAkB;AAAA;AAAA,aAEvB;AAAA,EACT;AACA,KAAG,qCAAqC,YAAY;AAChD,UAAM,KAAK,MAAM,QAAkB;AAAA;AAAA,SAElC;AAED,UAAM,eAAe,EAAE;AAEvB,UAAM,OAAO,EAAE,EAAE,GAAG,GAAG,WAAW;AAAA,EACtC,CAAC;AAED,KAAG,oCAAoC,YAAY;AAC/C,UAAM,KAAK,MAAM,QAAkB;AAAA;AAAA,SAElC;AAED,UAAM,eAAe,EAAE;AACvB,UAAM,WAAW,IAAI;AACrB,OAAG,iBAAiB,SAAS,MAAM,SAAS,CAAC;AAC7C,WAAO,SAAS,SAAS,EAAE,GAAG,MAAM,CAAC;AAErC,OAAG,cAAc,IAAI,aAAa,eAAe,EAAE,QAAQ,EAAE,CAAC,CAAC;AAC/D,OAAG,cAAc,IAAI,aAAa,WAAW,CAAC;AAE9C,WAAO,SAAS,SAAS,EAAE,GAAG,MAAM,CAAC;AAAA,EACzC,CAAC;AACL,CAAC;",
|
6
6
|
"names": []
|
7
7
|
}
|