Skip to content

Commit

Permalink
Add missing React Native specific end props
Browse files Browse the repository at this point in the history
  • Loading branch information
kristerkari committed Feb 21, 2018
1 parent bff3a2c commit 64f0fb1
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/__snapshots__/index.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,17 @@ Array [
"textDecorationStyle",
"letterSpacing",
"direction",
"end",
"start",
"elevation",
"borderEndWidth",
"borderStartWidth",
"borderStartColor",
"borderEndColor",
"borderBottomEndRadius",
"borderBottomStartRadius",
"borderTopEndRadius",
"borderTopStartRadius",
"textAlignVertical",
"textShadowColor",
"textShadowOffset",
Expand All @@ -83,8 +91,12 @@ Array [
"shadowRadius",
"marginHorizontal",
"marginVertical",
"marginEnd",
"marginStart",
"paddingHorizontal",
"paddingVertical",
"paddingEnd",
"paddingStart",
"decomposedMatrix",
"transformMatrix",
"resizeMode",
Expand Down Expand Up @@ -165,9 +177,17 @@ Array [
"textDecorationStyle",
"letterSpacing",
"direction",
"end",
"start",
"elevation",
"borderEndWidth",
"borderStartWidth",
"borderStartColor",
"borderEndColor",
"borderBottomEndRadius",
"borderBottomStartRadius",
"borderTopEndRadius",
"borderTopStartRadius",
"textAlignVertical",
"textShadowColor",
"textShadowOffset",
Expand All @@ -178,8 +198,12 @@ Array [
"shadowRadius",
"marginHorizontal",
"marginVertical",
"marginEnd",
"marginStart",
"paddingHorizontal",
"paddingVertical",
"paddingEnd",
"paddingStart",
"decomposedMatrix",
"transformMatrix",
"resizeMode",
Expand Down
12 changes: 12 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,17 @@ export const fontProps = [
export const writingModeProps = ["direction"];

export const reactNativeProps = [
"end",
"start",
"elevation",
"borderEndWidth",
"borderStartWidth",
"borderStartColor",
"borderEndColor",
"borderBottomEndRadius",
"borderBottomStartRadius",
"borderTopEndRadius",
"borderTopStartRadius",
"textAlignVertical",
"textShadowColor",
"textShadowOffset",
Expand All @@ -110,8 +118,12 @@ export const reactNativeProps = [
"shadowRadius",
"marginHorizontal",
"marginVertical",
"marginEnd",
"marginStart",
"paddingHorizontal",
"paddingVertical",
"paddingEnd",
"paddingStart",
"decomposedMatrix",
"transformMatrix",
"resizeMode",
Expand Down
14 changes: 14 additions & 0 deletions src/index.spec.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
import { allProps, allCSS2RNProps } from "./index";

const uniq = function(arrArg) {
return arrArg.filter(function(elem, pos, arr) {
return arr.indexOf(elem) == pos;
});
};

it("should have a flat array of all known React Native props", () => {
expect(allProps).toMatchSnapshot();
});

it("should not have duplicate props in all known React Native props", () => {
expect(allProps).toEqual(uniq(allProps));
});

it("should have a flat array of all known css-to-react-native props", () => {
expect(allCSS2RNProps).toMatchSnapshot();
});

it("should not have duplicate props in all known css-to-react-native props", () => {
expect(allCSS2RNProps).toEqual(uniq(allCSS2RNProps));
});

0 comments on commit 64f0fb1

Please sign in to comment.