Skip to content

Commit

Permalink
Feat(tdp-1717): remove react native from video (newsuk#2913)
Browse files Browse the repository at this point in the history
* Create some new styled components and remove some Text and View components

* Remove rest of react native from video package

* Fix linting

* Fix styleguide version discrepancy

* Update styleguide version in context package

* Update styleguid version in utils and responsive packages

Co-authored-by: Callum Christie <callumchristie@hotmail.com>
  • Loading branch information
bibicollins1 and flashcheeks committed Apr 12, 2022
1 parent bc73c83 commit 30553bc
Show file tree
Hide file tree
Showing 21 changed files with 143 additions and 397 deletions.
2 changes: 1 addition & 1 deletion packages/responsive/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
"homepage": "https://github.com/newsuk/times-components#readme",
"dependencies": {
"@times-components/styleguide": "3.38.33",
"@times-components/styleguide": "3.38.34",
"@times-components/utils": "6.7.1",
"prop-types": "15.7.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
},
"dependencies": {
"@times-components/schema": "0.7.1",
"@times-components/styleguide": "3.38.33",
"@times-components/styleguide": "3.38.34",
"apollo-cache-inmemory": "1.5.1",
"apollo-client": "2.5.1",
"apollo-link": "1.2.4",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`1. video with error 1`] = `
<div>
<styles__VideoErrorContainer>
<div>
Video unable to play
<styles__VideoErrorHeading>
<span>
Video unable to play
</span>
</styles__VideoErrorHeading>
<styles__VideoErrorBody>
<span>
Please check your network connection and try refreshing the page. If that doesn't work, please try again later
</span>
</styles__VideoErrorBody>
</div>
<div>
Please check your network connection and try refreshing the page. If that doesn't work, please try again later
</div>
</div>
</styles__VideoErrorContainer>
`;

This file was deleted.

46 changes: 0 additions & 46 deletions packages/video/__tests__/web/video-error-with-style.web.test.js

This file was deleted.

7 changes: 2 additions & 5 deletions packages/video/__tests__/web/video-error.web.test.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import React from "react";
import { AppRegistry } from "react-native-web";
import { mount } from "enzyme";
import {
addSerializers,
compose,
enzymeRenderedSerializer,
minimaliseTransform,
minimalWebTransform,
print,
rnwTransform
print
} from "@times-components/jest-serializer";
import VideoError from "../../src/video-error";

Expand All @@ -18,8 +16,7 @@ addSerializers(
compose(
print,
minimalWebTransform,
minimaliseTransform((value, key) => key === "style" || key === "className"),
rnwTransform(AppRegistry)
minimaliseTransform((value, key) => key === "style" || key === "className")
)
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import React from "react";
import { AppRegistry } from "react-native-web";
import TestRenderer from "react-test-renderer";
import {
addSerializers,
compose,
minimaliseTransform,
minimalWebTransform,
replacePropTransform,
rnwTransform,
stylePrinter
} from "@times-components/jest-serializer";
import { hash, iterator } from "@times-components/test-utils";
Expand All @@ -30,8 +28,7 @@ addSerializers(
minimalWebTransform,
replacePropTransform(
(value, key) => (key === "uri" || key === "poster" ? hash(value) : value)
),
rnwTransform(AppRegistry)
)
)
);

Expand Down
5 changes: 1 addition & 4 deletions packages/video/__tests__/web/video-with-provider.web.test.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import React from "react";
import { AppRegistry } from "react-native-web";
import TestRenderer from "react-test-renderer";
import {
addSerializers,
compose,
minimaliseTransform,
minimalWebTransform,
replacePropTransform,
rnwTransform,
stylePrinter
} from "@times-components/jest-serializer";
import { hash, iterator } from "@times-components/test-utils";
Expand Down Expand Up @@ -39,8 +37,7 @@ addSerializers(
minimalWebTransform,
replacePropTransform(
(value, key) => (key === "uri" || key === "poster" ? hash(value) : value)
),
rnwTransform(AppRegistry)
)
)
);

Expand Down
63 changes: 0 additions & 63 deletions packages/video/__tests__/web/video-with-style.web.test.js

This file was deleted.

7 changes: 1 addition & 6 deletions packages/video/__tests__/web/video.web.test.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import React from "react";
import { AppRegistry } from "react-native-web";
import TestRenderer from "react-test-renderer";
import {
addSerializers,
compose,
minimaliseTransform,
minimalWebTransform,
replacePropTransform,
rnwTransform,
stylePrinter
} from "@times-components/jest-serializer";
import { hash, iterator } from "@times-components/test-utils";
Expand All @@ -32,8 +30,7 @@ addSerializers(
minimalWebTransform,
replacePropTransform(
(value, key) => (key === "src" || key === "poster" ? hash(value) : value)
),
rnwTransform(AppRegistry)
)
)
);

Expand All @@ -44,7 +41,6 @@ const tests = [
const testInstance = TestRenderer.create(
<Video {...defaultVideoProps} is360 />
);

expect(testInstance.toJSON()).toMatchSnapshot();
}
},
Expand All @@ -57,7 +53,6 @@ const tests = [

const VideoComponent = testInstance.root.findAllByType(InlineVideoPlayer);
VideoComponent[0].instance.handlePlay();

expect(testInstance).toMatchSnapshot();
}
}
Expand Down
Loading

0 comments on commit 30553bc

Please sign in to comment.