@forge/react 11.13.0-next.0-experimental-bf21d1e → 11.13.0-next.2
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/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
# @forge/react
|
|
2
2
|
|
|
3
|
-
## 11.13.0-next.
|
|
3
|
+
## 11.13.0-next.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- c537777: Updated ExpandMenuItem to ExpandableMenuItem
|
|
8
|
+
|
|
9
|
+
## 11.13.0-next.1
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
6
12
|
|
|
7
|
-
-
|
|
13
|
+
- 16a4b01: Updated SDK to throw type error
|
|
8
14
|
|
|
9
15
|
### Patch Changes
|
|
10
16
|
|
|
11
|
-
-
|
|
17
|
+
- Updated dependencies [16a4b01]
|
|
18
|
+
- @forge/bridge@5.14.0-next.4
|
|
12
19
|
|
|
13
20
|
## 11.13.0-next.0
|
|
14
21
|
|
|
@@ -121,7 +121,7 @@ describe('Global component reconciliation', () => {
|
|
|
121
121
|
beforeAll(async () => {
|
|
122
122
|
bridgeCalls = (0, testUtils_1.setupBridge)();
|
|
123
123
|
const App = () => {
|
|
124
|
-
return ((0, jsx_runtime_1.jsxs)(components_1.Global, { children: [(0, jsx_runtime_1.jsxs)(components_1.Global.Sidebar, { forYouUrl: "for-you-test", children: [(0, jsx_runtime_1.jsx)(components_1.Global.LinkMenuItem, { label: "Link item 1", href: "1" }), (0, jsx_runtime_1.jsx)(components_1.Global.LinkMenuItem, { label: "Link item 2", href: "2" }), (0, jsx_runtime_1.jsx)(components_1.Global.LinkMenuItem, { label: "Link item 3", href: "3" }), (0, jsx_runtime_1.jsxs)(components_1.Global.
|
|
124
|
+
return ((0, jsx_runtime_1.jsxs)(components_1.Global, { children: [(0, jsx_runtime_1.jsxs)(components_1.Global.Sidebar, { forYouUrl: "for-you-test", children: [(0, jsx_runtime_1.jsx)(components_1.Global.LinkMenuItem, { label: "Link item 1", href: "1" }), (0, jsx_runtime_1.jsx)(components_1.Global.LinkMenuItem, { label: "Link item 2", href: "2" }), (0, jsx_runtime_1.jsx)(components_1.Global.LinkMenuItem, { label: "Link item 3", href: "3" }), (0, jsx_runtime_1.jsxs)(components_1.Global.ExpandableMenuItem, { label: `Campaign 49`, children: [(0, jsx_runtime_1.jsx)(components_1.Global.LinkMenuItem, { label: `Campaign 49 Home`, href: `campaigns/49` }), (0, jsx_runtime_1.jsx)(components_1.Global.LinkMenuItem, { label: `Feedback for Campaign 49`, href: `campaigns/49/feedback` })] }, 49), (0, jsx_runtime_1.jsxs)(components_1.Global.ExpandableMenuItem, { label: `Campaign 23`, children: [(0, jsx_runtime_1.jsx)(components_1.Global.LinkMenuItem, { label: `Campaign 23 Home`, href: `campaigns/23` }), (0, jsx_runtime_1.jsx)(components_1.Global.LinkMenuItem, { label: `Feedback for Campaign 23`, href: `campaigns/23/feedback` })] }, 23)] }), (0, jsx_runtime_1.jsx)(components_1.Global.Main, { children: (0, jsx_runtime_1.jsx)(components_1.Text, { children: "hello" }) })] }));
|
|
125
125
|
};
|
|
126
126
|
resetKeyCount();
|
|
127
127
|
await reconcilerTestRenderer_1.default.create((0, jsx_runtime_1.jsx)(App, {}));
|
|
@@ -5,6 +5,6 @@ export declare const Global: {
|
|
|
5
5
|
Main: TGlobalMain<ForgeElement<Record<string, any>>>;
|
|
6
6
|
Sidebar: TGlobalSidebar<ForgeElement<Record<string, any>>>;
|
|
7
7
|
LinkMenuItem: TGlobalLinkMenuItem<ForgeElement<Record<string, any>>>;
|
|
8
|
-
|
|
8
|
+
ExpandableMenuItem: TGlobalExpandableMenuItem<ForgeElement<Record<string, any>>>;
|
|
9
9
|
};
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -10,4 +10,4 @@ exports.Global = Global;
|
|
|
10
10
|
exports.Global.Main = 'Global.Main';
|
|
11
11
|
exports.Global.Sidebar = 'Global.Sidebar';
|
|
12
12
|
exports.Global.LinkMenuItem = 'Global.LinkMenuItem';
|
|
13
|
-
exports.Global.
|
|
13
|
+
exports.Global.ExpandableMenuItem = 'Global.ExpandableMenuItem';
|
|
@@ -740,6 +740,31 @@ describe('usePermissions', () => {
|
|
|
740
740
|
expect(result.current.missingPermissions?.external?.fetch?.client).toEqual(['http://example.com']);
|
|
741
741
|
});
|
|
742
742
|
});
|
|
743
|
+
describe('Input shape validation', () => {
|
|
744
|
+
beforeEach(() => {
|
|
745
|
+
mockGetContext.mockResolvedValue({
|
|
746
|
+
permissions: { scopes: ['read:confluence-content'] }
|
|
747
|
+
});
|
|
748
|
+
});
|
|
749
|
+
it.each([
|
|
750
|
+
[{ scopes: 'read:confluence-content' }, 'scopes should be an array, not a string'],
|
|
751
|
+
[{ external: 'https://api.example.com' }, 'external should be an object, not a string'],
|
|
752
|
+
[{ external: { fetch: ['https://api.example.com'] } }, 'external.fetch should be an object, not an array'],
|
|
753
|
+
[
|
|
754
|
+
{ external: { fetch: { backend: 'https://api.zoom.com' } } },
|
|
755
|
+
'external.fetch.backend should be an array, not a string'
|
|
756
|
+
]
|
|
757
|
+
])('should set error for invalid input %#', async (requiredPermissions, expectedMessage) => {
|
|
758
|
+
const { result } = (0, react_hooks_1.renderHook)(() => (0, usePermissions_1.usePermissions)(requiredPermissions));
|
|
759
|
+
await (0, react_hooks_1.act)(async () => {
|
|
760
|
+
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
761
|
+
});
|
|
762
|
+
expect(result.current.isLoading).toBe(false);
|
|
763
|
+
expect(result.current.hasPermission).toBe(false);
|
|
764
|
+
expect(result.current.error).toBeInstanceOf(TypeError);
|
|
765
|
+
expect(result.current.error?.message).toBe(expectedMessage);
|
|
766
|
+
});
|
|
767
|
+
});
|
|
743
768
|
describe('Edge cases', () => {
|
|
744
769
|
it('should handle empty required permissions', async () => {
|
|
745
770
|
const mockContext = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/react",
|
|
3
|
-
"version": "11.13.0-next.
|
|
3
|
+
"version": "11.13.0-next.2",
|
|
4
4
|
"description": "Forge React reconciler",
|
|
5
5
|
"author": "Atlassian",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@atlaskit/adf-schema": "^48.0.0",
|
|
33
33
|
"@atlaskit/adf-utils": "^19.19.0",
|
|
34
34
|
"@atlaskit/forge-react-types": "^0.62.0",
|
|
35
|
-
"@forge/bridge": "^5.
|
|
35
|
+
"@forge/bridge": "^5.14.0-next.4",
|
|
36
36
|
"@forge/egress": "^2.3.1",
|
|
37
37
|
"@forge/i18n": "0.0.7",
|
|
38
38
|
"@types/react": "^18.2.64",
|