creevey 0.9.0-beta.4 → 0.9.0-beta.5
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,3 +1,5 @@
|
|
1
|
+
# [0.9.0-beta.5](https://github.com/wKich/creevey/compare/v0.9.0-beta.4...v0.9.0-beta.5) (2023-04-14)
|
2
|
+
|
1
3
|
# [0.9.0-beta.4](https://github.com/wKich/creevey/compare/v0.9.0-beta.3...v0.9.0-beta.4) (2023-03-24)
|
2
4
|
|
3
5
|
# [0.9.0-beta.3](https://github.com/wKich/creevey/compare/v0.8.0...v0.9.0-beta.3) (2023-03-24)
|
@@ -10,8 +10,6 @@ var Events = _interopRequireWildcard(require("@storybook/core-events"));
|
|
10
10
|
|
11
11
|
var polyfill = _interopRequireWildcard(require("event-source-polyfill"));
|
12
12
|
|
13
|
-
var _testingLibrary = require("@storybook/testing-library");
|
14
|
-
|
15
13
|
var _addons = require("@storybook/addons");
|
16
14
|
|
17
15
|
var _types = require("../../types");
|
@@ -20,12 +18,12 @@ var _shared = require("../../shared");
|
|
20
18
|
|
21
19
|
var _helpers = require("../shared/helpers");
|
22
20
|
|
23
|
-
var _utils = require("./utils");
|
24
|
-
|
25
21
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
26
22
|
|
27
23
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
28
24
|
|
25
|
+
// import { buildQueries, within } from '@storybook/testing-library';
|
26
|
+
// import { isInternetExplorer } from './utils';
|
29
27
|
if (typeof process != 'object' || typeof process.version != 'string') {
|
30
28
|
// NOTE If you don't use babel-polyfill or any other polyfills that add EventSource for IE11
|
31
29
|
// You don't get hot reload in IE11. So put polyfill for that to better UX
|
@@ -279,22 +277,23 @@ function withCreevey() {
|
|
279
277
|
window.__CREEVEY_INSERT_IGNORE_STYLES__ = insertIgnoreStyles;
|
280
278
|
window.__CREEVEY_REMOVE_IGNORE_STYLES__ = removeIgnoreStyles;
|
281
279
|
window.__CREEVEY_HAS_PLAY_COMPLETED_YET__ = hasPlayCompletedYet;
|
282
|
-
window.__CREEVEY_SET_READY_FOR_CAPTURE__ = _types.noop;
|
283
|
-
|
284
|
-
const
|
285
|
-
|
286
|
-
const
|
287
|
-
|
288
|
-
|
280
|
+
window.__CREEVEY_SET_READY_FOR_CAPTURE__ = _types.noop; // const queryAllByQuery = (container: HTMLElement, query: string): HTMLElement[] =>
|
281
|
+
// [...container.querySelectorAll(query)].filter((e) => e instanceof HTMLElement) as HTMLElement[];
|
282
|
+
// const getMultipleError = (_: Element | null, query: string): string => `Found multiple elements by query: ${query}`;
|
283
|
+
// const getMissingError = (_: Element | null, query: string): string => `Unable to find an element by query: ${query}`;
|
284
|
+
// const [queryByQuery, getAllByQuery, getByQuery, findAllByQuery, findByQuery] = buildQueries(
|
285
|
+
// queryAllByQuery,
|
286
|
+
// getMultipleError,
|
287
|
+
// getMissingError,
|
288
|
+
// );
|
289
|
+
// const queries = {
|
290
|
+
// queryByQuery,
|
291
|
+
// getAllByQuery,
|
292
|
+
// getByQuery,
|
293
|
+
// findAllByQuery,
|
294
|
+
// findByQuery,
|
295
|
+
// };
|
289
296
|
|
290
|
-
const [queryByQuery, getAllByQuery, getByQuery, findAllByQuery, findByQuery] = (0, _testingLibrary.buildQueries)(queryAllByQuery, getMultipleError, getMissingError);
|
291
|
-
const queries = {
|
292
|
-
queryByQuery,
|
293
|
-
getAllByQuery,
|
294
|
-
getByQuery,
|
295
|
-
findAllByQuery,
|
296
|
-
findByQuery
|
297
|
-
};
|
298
297
|
return (0, _addons.makeDecorator)({
|
299
298
|
name: 'withCreevey',
|
300
299
|
parameterName: 'creevey',
|
@@ -315,8 +314,10 @@ function withCreevey() {
|
|
315
314
|
return Promise.resolve(document.documentElement);
|
316
315
|
|
317
316
|
case typeof captureElement == 'string':
|
318
|
-
return
|
319
|
-
|
317
|
+
return Promise.resolve(context.canvasElement.querySelector(captureElement));
|
318
|
+
// return isInternetExplorer // some code from testing-library makes IE hang
|
319
|
+
// ? Promise.resolve(context.canvasElement.querySelector(captureElement as string))
|
320
|
+
// : within<typeof queries>(context.canvasElement, queries).findByQuery(captureElement as string);
|
320
321
|
|
321
322
|
case typeof captureElement == 'function':
|
322
323
|
// TODO Define type for it
|
@@ -1,11 +1,10 @@
|
|
1
1
|
import * as Events from '@storybook/core-events';
|
2
2
|
import * as polyfill from 'event-source-polyfill';
|
3
|
-
import { buildQueries, within } from '@storybook/testing-library';
|
3
|
+
// import { buildQueries, within } from '@storybook/testing-library';
|
4
4
|
import { addons, makeDecorator } from '@storybook/addons';
|
5
5
|
import { isObject, noop } from '../../types';
|
6
6
|
import { denormalizeStoryParameters, serializeRawStories } from '../../shared';
|
7
|
-
import { getConnectionUrl } from '../shared/helpers';
|
8
|
-
import { isInternetExplorer } from './utils';
|
7
|
+
import { getConnectionUrl } from '../shared/helpers'; // import { isInternetExplorer } from './utils';
|
9
8
|
|
10
9
|
if (typeof process != 'object' || typeof process.version != 'string') {
|
11
10
|
// NOTE If you don't use babel-polyfill or any other polyfills that add EventSource for IE11
|
@@ -253,22 +252,23 @@ export function withCreevey() {
|
|
253
252
|
window.__CREEVEY_INSERT_IGNORE_STYLES__ = insertIgnoreStyles;
|
254
253
|
window.__CREEVEY_REMOVE_IGNORE_STYLES__ = removeIgnoreStyles;
|
255
254
|
window.__CREEVEY_HAS_PLAY_COMPLETED_YET__ = hasPlayCompletedYet;
|
256
|
-
window.__CREEVEY_SET_READY_FOR_CAPTURE__ = noop;
|
255
|
+
window.__CREEVEY_SET_READY_FOR_CAPTURE__ = noop; // const queryAllByQuery = (container: HTMLElement, query: string): HTMLElement[] =>
|
256
|
+
// [...container.querySelectorAll(query)].filter((e) => e instanceof HTMLElement) as HTMLElement[];
|
257
|
+
// const getMultipleError = (_: Element | null, query: string): string => `Found multiple elements by query: ${query}`;
|
258
|
+
// const getMissingError = (_: Element | null, query: string): string => `Unable to find an element by query: ${query}`;
|
259
|
+
// const [queryByQuery, getAllByQuery, getByQuery, findAllByQuery, findByQuery] = buildQueries(
|
260
|
+
// queryAllByQuery,
|
261
|
+
// getMultipleError,
|
262
|
+
// getMissingError,
|
263
|
+
// );
|
264
|
+
// const queries = {
|
265
|
+
// queryByQuery,
|
266
|
+
// getAllByQuery,
|
267
|
+
// getByQuery,
|
268
|
+
// findAllByQuery,
|
269
|
+
// findByQuery,
|
270
|
+
// };
|
257
271
|
|
258
|
-
const queryAllByQuery = (container, query) => [...container.querySelectorAll(query)].filter(e => e instanceof HTMLElement);
|
259
|
-
|
260
|
-
const getMultipleError = (_, query) => "Found multiple elements by query: ".concat(query);
|
261
|
-
|
262
|
-
const getMissingError = (_, query) => "Unable to find an element by query: ".concat(query);
|
263
|
-
|
264
|
-
const [queryByQuery, getAllByQuery, getByQuery, findAllByQuery, findByQuery] = buildQueries(queryAllByQuery, getMultipleError, getMissingError);
|
265
|
-
const queries = {
|
266
|
-
queryByQuery,
|
267
|
-
getAllByQuery,
|
268
|
-
getByQuery,
|
269
|
-
findAllByQuery,
|
270
|
-
findByQuery
|
271
|
-
};
|
272
272
|
return makeDecorator({
|
273
273
|
name: 'withCreevey',
|
274
274
|
parameterName: 'creevey',
|
@@ -289,8 +289,10 @@ export function withCreevey() {
|
|
289
289
|
return Promise.resolve(document.documentElement);
|
290
290
|
|
291
291
|
case typeof captureElement == 'string':
|
292
|
-
return
|
293
|
-
|
292
|
+
return Promise.resolve(context.canvasElement.querySelector(captureElement));
|
293
|
+
// return isInternetExplorer // some code from testing-library makes IE hang
|
294
|
+
// ? Promise.resolve(context.canvasElement.querySelector(captureElement as string))
|
295
|
+
// : within<typeof queries>(context.canvasElement, queries).findByQuery(captureElement as string);
|
294
296
|
|
295
297
|
case typeof captureElement == 'function':
|
296
298
|
// TODO Define type for it
|
package/lib/types/index.d.ts
CHANGED
@@ -1,2 +1,6 @@
|
|
1
1
|
/// <reference types="../../types/chai" />
|
2
2
|
export * from './types';
|
3
|
+
export { loadStories as browserStoriesProvider } from './server/storybook/providers/browser';
|
4
|
+
export { loadStories as nodejsStoriesProvider } from './server/storybook/providers/nodejs';
|
5
|
+
export { loadStories as hybridStoriesProvider } from './server/storybook/providers/hybrid';
|
6
|
+
export * from './server/testsFiles/parser';
|