@codecademy/codebytes 1.0.8 → 1.0.9-alpha.32eae481b.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.
|
@@ -6,7 +6,7 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
|
6
6
|
|
|
7
7
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
8
8
|
|
|
9
|
-
import { renderHook } from '@testing-library/react
|
|
9
|
+
import { renderHook } from '@testing-library/react';
|
|
10
10
|
import { useEverInView } from './useEverInView';
|
|
11
11
|
var mockUseIntersection = jest.fn();
|
|
12
12
|
jest.mock('./useIntersection', function () {
|
|
@@ -6,7 +6,7 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
|
6
6
|
|
|
7
7
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
8
8
|
|
|
9
|
-
import { act, renderHook } from '@testing-library/react
|
|
9
|
+
import { act, renderHook } from '@testing-library/react';
|
|
10
10
|
import { useIntersection } from './useIntersection';
|
|
11
11
|
var originalIntersectionObserver = window.IntersectionObserver;
|
|
12
12
|
var mockObserve = jest.fn();
|
|
@@ -79,7 +79,7 @@ describe('useIntersection', function () {
|
|
|
79
79
|
}, _callee2);
|
|
80
80
|
})));
|
|
81
81
|
it('returns the IntersectionObserverEntry from the callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
82
|
-
var fakeIntersectionObserverEntry, handler, _renderHook, result, rerender
|
|
82
|
+
var fakeIntersectionObserverEntry, handler, _renderHook, result, rerender;
|
|
83
83
|
|
|
84
84
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
85
85
|
while (1) {
|
|
@@ -100,7 +100,7 @@ describe('useIntersection', function () {
|
|
|
100
100
|
});
|
|
101
101
|
_renderHook = renderHook(function () {
|
|
102
102
|
return useIntersection(ref, options);
|
|
103
|
-
}), result = _renderHook.result, rerender = _renderHook.rerender
|
|
103
|
+
}), result = _renderHook.result, rerender = _renderHook.rerender; // Element hasn't been scrolled into view and therefore
|
|
104
104
|
// results.current should be null.
|
|
105
105
|
|
|
106
106
|
expect(result.current).toBeNull(); // Simulate element being scrolled into view
|
|
@@ -111,13 +111,9 @@ describe('useIntersection', function () {
|
|
|
111
111
|
expect(result.current).toEqual(fakeIntersectionObserverEntry); // We expect the results to remain the same after a rerender
|
|
112
112
|
|
|
113
113
|
rerender();
|
|
114
|
-
expect(result.current).toEqual(fakeIntersectionObserverEntry);
|
|
114
|
+
expect(result.current).toEqual(fakeIntersectionObserverEntry);
|
|
115
115
|
|
|
116
|
-
|
|
117
|
-
rerender();
|
|
118
|
-
expect(result.current).toBeNull();
|
|
119
|
-
|
|
120
|
-
case 12:
|
|
116
|
+
case 9:
|
|
121
117
|
case "end":
|
|
122
118
|
return _context3.stop();
|
|
123
119
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codecademy/codebytes",
|
|
3
3
|
"description": "Codebytes Editor",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.9-alpha.32eae481b.0",
|
|
5
5
|
"author": "Codecademy Engineering <dev@codecademy.com>",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@codecademy/tracking": "
|
|
7
|
+
"@codecademy/tracking": "1.0.7-alpha.32eae481b.0",
|
|
8
8
|
"@monaco-editor/react": "^4.4.5",
|
|
9
9
|
"js-base64": "^3.6.0",
|
|
10
10
|
"jsuri": "^1.3.1",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"dist/**/[A-Z]**/[A-Z]*.js",
|
|
40
40
|
"dist/**/[A-Z]**/index.js"
|
|
41
41
|
],
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "a3bccd6143ef3aabd520f4d9326a3eaf2d940c81"
|
|
43
43
|
}
|