@storybook/angular 7.6.0-alpha.2 → 7.6.0-alpha.4

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.
@@ -49,6 +49,11 @@
49
49
  "description": "Starts Storybook in documentation mode. Learn more about it : https://storybook.js.org/docs/react/writing-docs/build-documentation#preview-storybooks-documentation.",
50
50
  "default": false
51
51
  },
52
+ "test": {
53
+ "type": "boolean",
54
+ "description": "Build the static version of the sandbox optimized for testing purposes",
55
+ "default": false
56
+ },
52
57
  "compodoc": {
53
58
  "type": "boolean",
54
59
  "description": "Execute compodoc before.",
@@ -155,6 +155,7 @@ class AbstractRenderer {
155
155
  return hasChangedModuleMetadata;
156
156
  }
157
157
  }
158
+ exports.AbstractRenderer = AbstractRenderer;
158
159
  _a = AbstractRenderer;
159
160
  /**
160
161
  * Reset compiled components because we often want to compile the same component with
@@ -177,4 +178,3 @@ AbstractRenderer.resetCompiledComponents = async () => {
177
178
  */
178
179
  }
179
180
  };
180
- exports.AbstractRenderer = AbstractRenderer;
@@ -16,8 +16,8 @@ var ButtonAccent;
16
16
  (function (ButtonAccent) {
17
17
  ButtonAccent["Normal"] = "Normal";
18
18
  ButtonAccent["High"] = "High";
19
- })(ButtonAccent = exports.ButtonAccent || (exports.ButtonAccent = {}));
20
- let InputComponent = class InputComponent {
19
+ })(ButtonAccent || (exports.ButtonAccent = ButtonAccent = {}));
20
+ let InputComponent = exports.InputComponent = class InputComponent {
21
21
  constructor() {
22
22
  /** Appearance style of the button. */
23
23
  this.appearance = 'secondary';
@@ -58,10 +58,9 @@ __decorate([
58
58
  (0, core_1.Output)(),
59
59
  __metadata("design:type", Object)
60
60
  ], InputComponent.prototype, "onClick", void 0);
61
- InputComponent = __decorate([
61
+ exports.InputComponent = InputComponent = __decorate([
62
62
  (0, core_1.Component)({
63
63
  selector: 'doc-button',
64
64
  template: '<button>{{ label }}</button>',
65
65
  })
66
66
  ], InputComponent);
67
- exports.InputComponent = InputComponent;
@@ -10,11 +10,10 @@ exports.WithOfficialModule = void 0;
10
10
  const common_1 = require("@angular/common");
11
11
  const http_1 = require("@angular/common/http");
12
12
  const core_1 = require("@angular/core");
13
- let WithOfficialModule = class WithOfficialModule {
13
+ let WithOfficialModule = exports.WithOfficialModule = class WithOfficialModule {
14
14
  };
15
- WithOfficialModule = __decorate([
15
+ exports.WithOfficialModule = WithOfficialModule = __decorate([
16
16
  (0, core_1.NgModule)({
17
17
  imports: [common_1.CommonModule, http_1.HttpClientModule],
18
18
  })
19
19
  ], WithOfficialModule);
20
- exports.WithOfficialModule = WithOfficialModule;
@@ -88,6 +88,7 @@ class PropertyExtractor {
88
88
  }
89
89
  }
90
90
  }
91
+ exports.PropertyExtractor = PropertyExtractor;
91
92
  _a = PropertyExtractor;
92
93
  PropertyExtractor.analyzeRestricted = (ngModule) => {
93
94
  if (ngModule === platform_browser_1.BrowserModule) {
@@ -159,4 +160,3 @@ PropertyExtractor.isDecoratorInstanceOf = (decorator, name) => {
159
160
  }
160
161
  return decorator instanceof factory || decorator.ngMetadataName === name;
161
162
  };
162
- exports.PropertyExtractor = PropertyExtractor;
@@ -20,7 +20,7 @@ var ButtonAccent;
20
20
  (function (ButtonAccent) {
21
21
  ButtonAccent["Normal"] = "Normal";
22
22
  ButtonAccent["High"] = "High";
23
- })(ButtonAccent = exports.ButtonAccent || (exports.ButtonAccent = {}));
23
+ })(ButtonAccent || (exports.ButtonAccent = ButtonAccent = {}));
24
24
  /**
25
25
  * This is a simple button that demonstrates various JSDoc handling in Storybook Docs for Angular.
26
26
  *
@@ -34,7 +34,7 @@ var ButtonAccent;
34
34
  * @code `ThingThing`
35
35
  * @html <span class="badge">aaa</span>
36
36
  */
37
- let InputComponent = class InputComponent {
37
+ let InputComponent = exports.InputComponent = class InputComponent {
38
38
  constructor() {
39
39
  /** Appearance style of the button. */
40
40
  this.appearance = 'secondary';
@@ -198,10 +198,9 @@ __decorate([
198
198
  __metadata("design:type", Array),
199
199
  __metadata("design:paramtypes", [Array])
200
200
  ], InputComponent.prototype, "item", null);
201
- InputComponent = __decorate([
201
+ exports.InputComponent = InputComponent = __decorate([
202
202
  (0, core_1.Component)({
203
203
  selector: 'doc-button',
204
204
  template: '<button>{{ label }}</button>',
205
205
  })
206
206
  ], InputComponent);
207
- exports.InputComponent = InputComponent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/angular",
3
- "version": "7.6.0-alpha.2",
3
+ "version": "7.6.0-alpha.4",
4
4
  "description": "Storybook for Angular: Develop Angular components in isolation with hot reloading.",
5
5
  "keywords": [
6
6
  "storybook",
@@ -37,20 +37,20 @@
37
37
  "prep": "../../../scripts/prepare/tsc.ts"
38
38
  },
39
39
  "dependencies": {
40
- "@storybook/builder-webpack5": "7.6.0-alpha.2",
41
- "@storybook/cli": "7.6.0-alpha.2",
42
- "@storybook/client-logger": "7.6.0-alpha.2",
43
- "@storybook/core-common": "7.6.0-alpha.2",
44
- "@storybook/core-events": "7.6.0-alpha.2",
45
- "@storybook/core-server": "7.6.0-alpha.2",
46
- "@storybook/core-webpack": "7.6.0-alpha.2",
47
- "@storybook/docs-tools": "7.6.0-alpha.2",
40
+ "@storybook/builder-webpack5": "7.6.0-alpha.4",
41
+ "@storybook/cli": "7.6.0-alpha.4",
42
+ "@storybook/client-logger": "7.6.0-alpha.4",
43
+ "@storybook/core-common": "7.6.0-alpha.4",
44
+ "@storybook/core-events": "7.6.0-alpha.4",
45
+ "@storybook/core-server": "7.6.0-alpha.4",
46
+ "@storybook/core-webpack": "7.6.0-alpha.4",
47
+ "@storybook/docs-tools": "7.6.0-alpha.4",
48
48
  "@storybook/global": "^5.0.0",
49
- "@storybook/manager-api": "7.6.0-alpha.2",
50
- "@storybook/node-logger": "7.6.0-alpha.2",
51
- "@storybook/preview-api": "7.6.0-alpha.2",
52
- "@storybook/telemetry": "7.6.0-alpha.2",
53
- "@storybook/types": "7.6.0-alpha.2",
49
+ "@storybook/manager-api": "7.6.0-alpha.4",
50
+ "@storybook/node-logger": "7.6.0-alpha.4",
51
+ "@storybook/preview-api": "7.6.0-alpha.4",
52
+ "@storybook/telemetry": "7.6.0-alpha.4",
53
+ "@storybook/types": "7.6.0-alpha.4",
54
54
  "@types/node": "^18.0.0",
55
55
  "@types/react": "^16.14.34",
56
56
  "@types/react-dom": "^16.9.14",
@@ -81,7 +81,7 @@
81
81
  "@types/cross-spawn": "^6.0.2",
82
82
  "@types/tmp": "^0.2.3",
83
83
  "cross-spawn": "^7.0.3",
84
- "jest": "^29.3.1",
84
+ "jest": "^29.7.0",
85
85
  "jest-preset-angular": "^13.0.1",
86
86
  "jest-specific-snapshot": "^8.0.0",
87
87
  "tmp": "^0.2.1",
@@ -1,7 +1,7 @@
1
1
  import type { Meta, StoryObj } from '@storybook/angular';
2
2
  import { moduleMetadata } from '@storybook/angular';
3
- import { within, userEvent } from '@storybook/testing-library';
4
3
  import { CommonModule } from '@angular/common';
4
+ import { within, userEvent, expect } from '@storybook/test';
5
5
 
6
6
  import Button from './button.component';
7
7
  import Header from './header.component';
@@ -38,9 +38,12 @@ export const LoggedIn: Story = {
38
38
  }),
39
39
  play: async ({ canvasElement }) => {
40
40
  const canvas = within(canvasElement);
41
- const loginButton = await canvas.getByRole('button', {
42
- name: /Log in/i,
43
- });
41
+ const loginButton = canvas.getByRole('button', { name: /Log in/i });
42
+ await expect(loginButton).toBeInTheDocument();
44
43
  await userEvent.click(loginButton);
44
+ await expect(loginButton).not.toBeInTheDocument();
45
+
46
+ const logoutButton = canvas.getByRole('button', { name: /Log out/i });
47
+ await expect(logoutButton).toBeInTheDocument();
45
48
  },
46
49
  };