@backstage/plugin-techdocs-addons-test-utils 2.0.0-next.1 → 2.0.0

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.
Files changed (2) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/package.json +11 -11
package/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # @backstage/plugin-techdocs-addons-test-utils
2
2
 
3
+ ## 2.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - 8d6709e: **BREAKING**: `TechDocsAddonTester.renderWithEffects()` no longer returns a screen; this means that you can no longer grab assertions such as `getByText` from its return value.
8
+
9
+ Newer versions of `@testing-library` recommends using the `screen` export for assertions - and removing this from the addon tester contract allows us to more freely iterate on which underlying version of the testing library is being used.
10
+
11
+ One notable effect of this, however, is that the `@testing-library` `screen` does NOT support assertions on the shadow DOM, which techdocs relies on. You will therefore want to add a dependency on [the `shadow-dom-testing-library` package](https://github.com/konnorrogers/shadow-dom-testing-library/) in your tests, and using its `screen` and its dedicated `*Shadow*` methods. As an example, if you keep doing `getByText` you will not get matches inside the shadow DOM - switch to `getByShadowText` instead.
12
+
13
+ ```ts
14
+ import { screen } from 'shadow-dom-testing-library';
15
+
16
+ // ... render the addon ...
17
+ await TechDocsAddonTester.buildAddonsInTechDocs([<AnAddon />])
18
+ .withDom(<body>TEST_CONTENT</body>)
19
+ .renderWithEffects();
20
+
21
+ expect(screen.getByShadowText('TEST_CONTENT')).toBeInTheDocument();
22
+ ```
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies
27
+ - @backstage/core-app-api@1.19.3
28
+ - @backstage/plugin-techdocs@1.16.1
29
+ - @backstage/plugin-catalog@1.32.1
30
+ - @backstage/plugin-catalog-react@1.21.4
31
+ - @backstage/plugin-search-react@1.10.1
32
+ - @backstage/test-utils@1.7.14
33
+ - @backstage/core-plugin-api@1.12.1
34
+ - @backstage/integration-react@1.2.13
35
+ - @backstage/plugin-techdocs-react@1.3.6
36
+
3
37
  ## 2.0.0-next.1
4
38
 
5
39
  ### Major Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-techdocs-addons-test-utils",
3
- "version": "2.0.0-next.1",
3
+ "version": "2.0.0",
4
4
  "backstage": {
5
5
  "role": "web-library",
6
6
  "pluginId": "techdocs-addons",
@@ -40,19 +40,19 @@
40
40
  "test": "backstage-cli package test"
41
41
  },
42
42
  "dependencies": {
43
- "@backstage/core-app-api": "1.19.3-next.0",
44
- "@backstage/core-plugin-api": "1.12.1-next.0",
45
- "@backstage/integration-react": "1.2.13-next.0",
46
- "@backstage/plugin-catalog": "1.32.1-next.0",
47
- "@backstage/plugin-catalog-react": "1.21.4-next.1",
48
- "@backstage/plugin-search-react": "1.10.1-next.0",
49
- "@backstage/plugin-techdocs": "1.16.1-next.1",
50
- "@backstage/plugin-techdocs-react": "1.3.6-next.0",
51
- "@backstage/test-utils": "1.7.14-next.0",
43
+ "@backstage/core-app-api": "^1.19.3",
44
+ "@backstage/core-plugin-api": "^1.12.1",
45
+ "@backstage/integration-react": "^1.2.13",
46
+ "@backstage/plugin-catalog": "^1.32.1",
47
+ "@backstage/plugin-catalog-react": "^1.21.4",
48
+ "@backstage/plugin-search-react": "^1.10.1",
49
+ "@backstage/plugin-techdocs": "^1.16.1",
50
+ "@backstage/plugin-techdocs-react": "^1.3.6",
51
+ "@backstage/test-utils": "^1.7.14",
52
52
  "shadow-dom-testing-library": "^1.13.1"
53
53
  },
54
54
  "devDependencies": {
55
- "@backstage/cli": "0.34.6-next.1",
55
+ "@backstage/cli": "^0.35.0",
56
56
  "@testing-library/dom": "^10.0.0",
57
57
  "@testing-library/jest-dom": "^6.0.0",
58
58
  "@types/react": "^18.0.0",