@flighthq/dialog 0.3.0-next.1220.6982c21 → 0.3.0-next.1272.222de94
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 +2 -2
- package/src/dialog.test.ts +20 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flighthq/dialog",
|
|
3
|
-
"version": "0.3.0-next.
|
|
3
|
+
"version": "0.3.0-next.1272.222de94",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/flighthq/flight.git",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"clean:dist": "tsx ../../scripts/clean-package-dist.ts"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@flighthq/types": "0.3.0-next.
|
|
39
|
+
"@flighthq/types": "0.3.0-next.1272.222de94"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"typescript": "^5.3.0"
|
package/src/dialog.test.ts
CHANGED
|
@@ -55,6 +55,26 @@ describe('createWebDialogBackend', () => {
|
|
|
55
55
|
expect(typeof (await backend.confirm({ message: 'sure?' }))).toBe('boolean');
|
|
56
56
|
});
|
|
57
57
|
|
|
58
|
+
it('does not send an empty accept map for an all-wildcard filter', async () => {
|
|
59
|
+
const previous = Object.getOwnPropertyDescriptor(window, 'showOpenFilePicker');
|
|
60
|
+
let pickerOptions: unknown;
|
|
61
|
+
Object.defineProperty(window, 'showOpenFilePicker', {
|
|
62
|
+
configurable: true,
|
|
63
|
+
value: async (options: unknown) => {
|
|
64
|
+
pickerOptions = options;
|
|
65
|
+
return [];
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
try {
|
|
69
|
+
const backend = createWebDialogBackend();
|
|
70
|
+
await backend.openFile({ filters: [{ extensions: ['*'], name: 'All files' }] });
|
|
71
|
+
expect(pickerOptions).toEqual({ multiple: false });
|
|
72
|
+
} finally {
|
|
73
|
+
if (previous === undefined) delete (window as Window & { showOpenFilePicker?: unknown }).showOpenFilePicker;
|
|
74
|
+
else Object.defineProperty(window, 'showOpenFilePicker', previous);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
|
|
58
78
|
it('message returns a result object without throwing', async () => {
|
|
59
79
|
const backend = createWebDialogBackend();
|
|
60
80
|
const result = await backend.message({ message: 'hi', checkboxChecked: true });
|