@frontify/guideline-blocks-settings 0.31.1 → 0.31.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,5 +1,12 @@
1
1
  # @frontify/guideline-blocks-settings
2
2
 
3
+ ## 0.31.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`68a9298`](https://github.com/Frontify/brand-sdk/commit/68a9298df9e2177e70333f47dc433a056d76625b)]:
8
+ - @frontify/app-bridge@3.1.0
9
+
3
10
  ## 0.31.1
4
11
 
5
12
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- /// <reference types="react" />
2
-
3
1
  import { AnyObject } from '@udecode/plate';
4
2
  import { AppBridgeBlock } from '@frontify/app-bridge';
5
3
  import type { AppBridgeTheme } from '@frontify/app-bridge';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontify/guideline-blocks-settings",
3
- "version": "0.31.1",
3
+ "version": "0.31.2",
4
4
  "description": "Provides types and helpers for the guideline block development",
5
5
  "sideEffects": false,
6
6
  "main": "dist/index.umd.js",
@@ -65,7 +65,7 @@
65
65
  "@frontify/sidebar-settings": "^0.9.1"
66
66
  },
67
67
  "peerDependencies": {
68
- "@frontify/app-bridge": "^3.0.0",
68
+ "@frontify/app-bridge": "^3.0.0 || ^4.0.0-alpha.0",
69
69
  "react": "^18",
70
70
  "react-dom": "^18"
71
71
  },
package/setupTests.ts CHANGED
@@ -1,11 +1,16 @@
1
1
  /* (c) Copyright Frontify Ltd., all rights reserved. */
2
2
 
3
- import { afterEach, vi } from 'vitest';
3
+ import { afterEach, beforeAll, vi } from 'vitest';
4
+ import { configure } from '@testing-library/react';
4
5
 
5
6
  vi.stubGlobal('crypto', {
6
7
  getRandomValues: vi.fn(),
7
8
  });
8
9
 
10
+ beforeAll(() => {
11
+ configure({ testIdAttribute: 'data-test-id' });
12
+ });
13
+
9
14
  afterEach(() => {
10
15
  vi.restoreAllMocks();
11
16
  });
@@ -8,11 +8,7 @@ import { AttachmentsProvider, useAttachments, useAttachmentsContext, withAttachm
8
8
 
9
9
  const MOCK_SETTINGS_ID = 'attachments';
10
10
 
11
- /**
12
- * @vitest-environment happy-dom
13
- */
14
-
15
- describe('useAttachments', () => {
11
+ describe('useAttachments', async () => {
16
12
  it('should have 1 attachment if attachment is added', async () => {
17
13
  const STUB_WITH_NO_ASSETS = getAppBridgeBlockStub({
18
14
  blockId: 1,
@@ -115,7 +111,7 @@ describe('withAttachmentsProvider', () => {
115
111
  return (
116
112
  <ul>
117
113
  {context.attachments.map((attachment) => (
118
- <li key={attachment.id} role="list">
114
+ <li key={attachment.id} data-test-id="item-test">
119
115
  {attachment.id}
120
116
  </li>
121
117
  ))}
@@ -123,8 +119,8 @@ describe('withAttachmentsProvider', () => {
123
119
  );
124
120
  }, MOCK_SETTINGS_ID);
125
121
 
126
- const { getAllByRole } = render(<Component appBridge={STUB_WITH_THREE_ASSETS} />);
122
+ const { getAllByTestId } = render(<Component appBridge={STUB_WITH_THREE_ASSETS} />);
127
123
 
128
- await waitFor(() => expect(getAllByRole('list')).toHaveLength(3));
124
+ await waitFor(() => expect(getAllByTestId('item-test')).toHaveLength(3));
129
125
  });
130
126
  });