Skip to content
Commits on Source (4)
......@@ -32,6 +32,8 @@ emoji=true
esproposal.optional_chaining=enable
esproposal.nullish_coalescing=enable
esproposal.decorators=ignore
esproposal.class_static_fields=enable
esproposal.class_instance_fields=enable
module.system=haste
module.system.haste.use_name_reducers=true
......
function load(count) {
function load(count, container) {
let activities = [...Array(count)].map((_, i) => {
const code = 'activityguid' + i;
......@@ -20,11 +20,11 @@ function load(count) {
type: "user",
subtype: false,
time_created: "1522036284",
getAvatarSource: () => {
return {
source:'http://thisisaurl'
}
}
// getAvatarSource: () => {
// return {
// source:'http://thisisaurl'
// }
// }
},
shouldBeBlured: jest.fn(),
message:"Message",
......@@ -37,19 +37,20 @@ function load(count) {
wire_totals: {
tokens: 1000000000000000000
},
_list: {
viewed: {
viewed: new Map([["1019155171608096768",true]]),
addViewed: () => {
return;
}
}
},
getThumbSource: () => {
return {
source:'http://thisisaurl'
}
}
containerObj: container
// _list: {
// viewed: {
// viewed: new Map([["1019155171608096768",true]]),
// addViewed: () => {
// return;
// }
// }
// },
// getThumbSource: () => {
// return {
// source:'http://thisisaurl'
// }
// }
}
});
......
export default {
};
\ No newline at end of file
import 'react-native';
import React from 'react';
import { shallow } from 'enzyme';
import {
FlatList,
KeyboardAvoidingView
} from 'react-native';
import ActivityScreen from '../../../src/newsfeed/ActivityScreen';
// import SingleEntityStore from '../../../src/common/stores/SingleEntityStore';
import RichEmbedStore from '../../../src/common/stores/RichEmbedStore';
import commentsStoreProvider from '../../../src/comments/CommentsStoreProvider';
import { commentsServiceFaker } from '../../../__mocks__/fake/CommentsFaker';
import { activitiesServiceFaker } from '../../../__mocks__/fake/ActivitiesFaker';
import CommentList from '../../../src/comments/CommentList';
jest.mock('../../../src/newsfeed/NewsfeedService');
import { getSingle } from '../../../src/newsfeed/NewsfeedService';
import entitiesService from '../../../src/common/services/entities.service';
jest.mock('../../../src/common/BaseModel');
jest.mock('../../../src/newsfeed/NewsfeedService');
jest.mock('../../../src/newsfeed/activity/Activity', () => 'Activity');
jest.mock('../../../src/comments/CommentList', () => 'CommentList');
jest.mock('../../../src/common/components/CenteredLoading', () => 'CenteredLoading');
......@@ -65,7 +58,7 @@ describe('Activity screen component', () => {
expect(screen).toMatchSnapshot();
// unmount
await screen.instance().componentDidMount();
await screen.instance().loadEntity();
jest.runAllTicks();
......
import 'react-native';
import React from 'react';
import { Text, TouchableOpacity } from "react-native";
import { shallow } from 'enzyme';
import { activitiesServiceFaker } from '../../../__mocks__/fake/ActivitiesFaker';
import renderer from 'react-test-renderer';
import OwnerBlock from '../../../src/newsfeed/activity/OwnerBlock';
import withPreventDoubleTap from '../../../src/common/components/PreventDoubleTap';
import ActivityModel from '../../../src/newsfeed/ActivityModel';
// const DebouncedTouchableOpacity = withPreventDoubleTap(TouchableOpacity);
describe('Owner component', () => {
let screen;
beforeEach(() => {
const TouchableOpacityCustom = <TouchableOpacity onPress={this.onPress} />;
const navigation = { navigate: jest.fn(), push: jest.fn() };
let activityResponse = activitiesServiceFaker().load(1);
let screen, entity, navigation;
beforeEach(() => {
navigation = { navigate: jest.fn(), push: jest.fn() };
const activityResponse = activitiesServiceFaker().load(1, {guid:1, name:'group'});
entity = ActivityModel.create(activityResponse.activities[0]);
screen = shallow(
<OwnerBlock entity ={activityResponse.activities[0]} navigation={navigation} rightToolbar={null}/>
<OwnerBlock entity ={entity} navigation={navigation} rightToolbar={null}/>
);
jest.runAllTimers();
});
it('renders correctly', async () => {
......@@ -33,58 +28,28 @@ describe('Owner component', () => {
it('should have PreventDoubleTap', async () => {
screen.update();
expect(screen.find('PreventDoubleTap')).toHaveLength(2);
expect(screen.find('PreventDoubleTap')).toHaveLength(3);
});
it('should _navToChannel on press ', () => {
let activityResponse = activitiesServiceFaker().load(1);
const navigation = {
navigate: jest.fn(),
push: jest.fn()
};
let entity = activityResponse.activities[0];
entity.containerObj = { guid: 'guidguid' };
screen = shallow(
<OwnerBlock entity={entity} navigation={navigation} rightToolbar={null}/>
);
screen.update()
let touchables = screen.find('PreventDoubleTap');
touchables.at(0).props().onPress();
jest.runAllTimers();
expect(navigation.push).toHaveBeenCalledWith('Channel', {'entity': entity.ownerObj, 'guid': entity.ownerObj.guid});
expect(screen.find('PreventDoubleTap')).toHaveLength(3);
});
it('should nav to groups on press ', () => {
let activityResponse = activitiesServiceFaker().load(1);
const navigation = {
navigate: jest.fn(),
push: jest.fn()
};
let entity = activityResponse.activities[0];
entity.containerObj = { guid: 'guidguid' };
screen = shallow(
<OwnerBlock entity={entity} navigation={navigation} rightToolbar={null}/>
);
screen.update()
let touchables = screen.find('PreventDoubleTap');
expect(screen.find('PreventDoubleTap')).toHaveLength(3);
//group touchable
touchables.at(2).props().onPress();
jest.runAllTimers();
expect(navigation.push).toHaveBeenCalled();
expect(navigation.push).toHaveBeenCalledWith('GroupView', {"group": {"guid": 1, "name": "group"}});
});
});
import 'react-native';
import React from 'react';
import { Text, TouchableOpacity } from "react-native";
import { TouchableOpacity } from "react-native";
import { shallow } from 'enzyme';
import { activitiesServiceFaker } from '../../../__mocks__/fake/ActivitiesFaker';
import renderer from 'react-test-renderer';
import RemindOwnerBlock from '../../../src/newsfeed/activity/RemindOwnerBlock';
import formatDate from '../../../src/common/helpers/date';
import domain from '../../../src/common/helpers/domain';
import ActivityModel from '../../../src/newsfeed/ActivityModel';
describe('Remind owner component', () => {
let user, comments, entity, screen;
let entity, screen, navigation;
beforeEach(() => {
let activityResponse = activitiesServiceFaker().load(1);
entity = ActivityModel.create(activitiesServiceFaker().load(1).activities[0]);
navigation = {
navigate: jest.fn(),
push: jest.fn(),
};
screen = shallow(
<RemindOwnerBlock entity={activityResponse.activities[0]}/>
<RemindOwnerBlock entity={entity} navigation={navigation}/>
);
jest.runAllTimers();
});
it('renders correctly', async () => {
......@@ -36,26 +36,12 @@ describe('Remind owner component', () => {
it('should _navToChannel on press ', () => {
let activityResponse = activitiesServiceFaker().load(1);
const navigation = {
navigate: jest.fn(),
push: jest.fn(),
};
let entity = activityResponse.activities[0];
screen = shallow(
<RemindOwnerBlock entity={entity} navigation={navigation} rightToolbar={null}/>
);
screen.update()
let touchables = screen.find('TouchableOpacity');
touchables.at(0).props().onPress();
jest.runAllTimers();
expect(navigation.push).toHaveBeenCalledWith('Channel', {'entity': entity.ownerObj, 'guid': entity.ownerObj.guid});
expect(screen.find(TouchableOpacity)).toHaveLength(2);
});
});
......@@ -17,24 +17,17 @@ exports[`Activity component renders correctly 1`] = `
<Pinned
entity={
ActivityModel {
"__list": Object {
"viewed": Object {
"addViewed": [Function],
"viewed": Map {
"1019155171608096768" => true,
},
},
},
"__list": null,
"allow_comments": true,
"attachment_guid": false,
"blurb": false,
"comments:count": undefined,
"containerObj": undefined,
"container_guid": "activityguid0",
"custom_data": false,
"custom_type": false,
"description": "Congratulations! ",
"edited": "",
"getThumbSource": [Function],
"guid": "activityguid0",
"is_visible": true,
"mature": false,
......@@ -42,7 +35,6 @@ exports[`Activity component renders correctly 1`] = `
"message": "Message",
"ownerObj": UserModel {
"__list": null,
"getAvatarSource": [Function],
"guid": "824853017709780997",
"subtype": false,
"time_created": "1522036284",
......@@ -83,24 +75,17 @@ exports[`Activity component renders correctly 1`] = `
<OwnerBlock
entity={
ActivityModel {
"__list": Object {
"viewed": Object {
"addViewed": [Function],
"viewed": Map {
"1019155171608096768" => true,
},
},
},
"__list": null,
"allow_comments": true,
"attachment_guid": false,
"blurb": false,
"comments:count": undefined,
"containerObj": undefined,
"container_guid": "activityguid0",
"custom_data": false,
"custom_type": false,
"description": "Congratulations! ",
"edited": "",
"getThumbSource": [Function],
"guid": "activityguid0",
"is_visible": true,
"mature": false,
......@@ -108,7 +93,6 @@ exports[`Activity component renders correctly 1`] = `
"message": "Message",
"ownerObj": UserModel {
"__list": null,
"getAvatarSource": [Function],
"guid": "824853017709780997",
"subtype": false,
"time_created": "1522036284",
......@@ -165,24 +149,17 @@ exports[`Activity component renders correctly 1`] = `
<ActivityActionSheet
entity={
ActivityModel {
"__list": Object {
"viewed": Object {
"addViewed": [Function],
"viewed": Map {
"1019155171608096768" => true,
},
},
},
"__list": null,
"allow_comments": true,
"attachment_guid": false,
"blurb": false,
"comments:count": undefined,
"containerObj": undefined,
"container_guid": "activityguid0",
"custom_data": false,
"custom_type": false,
"description": "Congratulations! ",
"edited": "",
"getThumbSource": [Function],
"guid": "activityguid0",
"is_visible": true,
"mature": false,
......@@ -190,7 +167,6 @@ exports[`Activity component renders correctly 1`] = `
"message": "Message",
"ownerObj": UserModel {
"__list": null,
"getAvatarSource": [Function],
"guid": "824853017709780997",
"subtype": false,
"time_created": "1522036284",
......@@ -275,24 +251,17 @@ exports[`Activity component renders correctly 1`] = `
<ExplicitText
entity={
ActivityModel {
"__list": Object {
"viewed": Object {
"addViewed": [Function],
"viewed": Map {
"1019155171608096768" => true,
},
},
},
"__list": null,
"allow_comments": true,
"attachment_guid": false,
"blurb": false,
"comments:count": undefined,
"containerObj": undefined,
"container_guid": "activityguid0",
"custom_data": false,
"custom_type": false,
"description": "Congratulations! ",
"edited": "",
"getThumbSource": [Function],
"guid": "activityguid0",
"is_visible": true,
"mature": false,
......@@ -300,7 +269,6 @@ exports[`Activity component renders correctly 1`] = `
"message": "Message",
"ownerObj": UserModel {
"__list": null,
"getAvatarSource": [Function],
"guid": "824853017709780997",
"subtype": false,
"time_created": "1522036284",
......@@ -352,24 +320,17 @@ exports[`Activity component renders correctly 1`] = `
<Translate
entity={
ActivityModel {
"__list": Object {
"viewed": Object {
"addViewed": [Function],
"viewed": Map {
"1019155171608096768" => true,
},
},
},
"__list": null,
"allow_comments": true,
"attachment_guid": false,
"blurb": false,
"comments:count": undefined,
"containerObj": undefined,
"container_guid": "activityguid0",
"custom_data": false,
"custom_type": false,
"description": "Congratulations! ",
"edited": "",
"getThumbSource": [Function],
"guid": "activityguid0",
"is_visible": true,
"mature": false,
......@@ -377,7 +338,6 @@ exports[`Activity component renders correctly 1`] = `
"message": "Message",
"ownerObj": UserModel {
"__list": null,
"getAvatarSource": [Function],
"guid": "824853017709780997",
"subtype": false,
"time_created": "1522036284",
......@@ -425,24 +385,17 @@ exports[`Activity component renders correctly 1`] = `
<MediaView
entity={
ActivityModel {
"__list": Object {
"viewed": Object {
"addViewed": [Function],
"viewed": Map {
"1019155171608096768" => true,
},
},
},
"__list": null,
"allow_comments": true,
"attachment_guid": false,
"blurb": false,
"comments:count": undefined,
"containerObj": undefined,
"container_guid": "activityguid0",
"custom_data": false,
"custom_type": false,
"description": "Congratulations! ",
"edited": "",
"getThumbSource": [Function],
"guid": "activityguid0",
"is_visible": true,
"mature": false,
......@@ -450,7 +403,6 @@ exports[`Activity component renders correctly 1`] = `
"message": "Message",
"ownerObj": UserModel {
"__list": null,
"getAvatarSource": [Function],
"guid": "824853017709780997",
"subtype": false,
"time_created": "1522036284",
......@@ -504,24 +456,17 @@ exports[`Activity component renders correctly 1`] = `
<Actions
entity={
ActivityModel {
"__list": Object {
"viewed": Object {
"addViewed": [Function],
"viewed": Map {
"1019155171608096768" => true,
},
},
},
"__list": null,
"allow_comments": true,
"attachment_guid": false,
"blurb": false,
"comments:count": undefined,
"containerObj": undefined,
"container_guid": "activityguid0",
"custom_data": false,
"custom_type": false,
"description": "Congratulations! ",
"edited": "",
"getThumbSource": [Function],
"guid": "activityguid0",
"is_visible": true,
"mature": false,
......@@ -529,7 +474,6 @@ exports[`Activity component renders correctly 1`] = `
"message": "Message",
"ownerObj": UserModel {
"__list": null,
"getAvatarSource": [Function],
"guid": "824853017709780997",
"subtype": false,
"time_created": "1522036284",
......@@ -576,24 +520,17 @@ exports[`Activity component renders correctly 1`] = `
<ActivityMetrics
entity={
ActivityModel {
"__list": Object {
"viewed": Object {
"addViewed": [Function],
"viewed": Map {
"1019155171608096768" => true,
},
},
},
"__list": null,
"allow_comments": true,
"attachment_guid": false,
"blurb": false,
"comments:count": undefined,
"containerObj": undefined,
"container_guid": "activityguid0",
"custom_data": false,
"custom_type": false,
"description": "Congratulations! ",
"edited": "",
"getThumbSource": [Function],
"guid": "activityguid0",
"is_visible": true,
"mature": false,
......@@ -601,7 +538,6 @@ exports[`Activity component renders correctly 1`] = `
"message": "Message",
"ownerObj": UserModel {
"__list": null,
"getAvatarSource": [Function],
"guid": "824853017709780997",
"subtype": false,
"time_created": "1522036284",
......
......@@ -18,27 +18,18 @@ exports[`Activity screen component renders correctly with an entity as param 2`]
<CommentList
entity={
Object {
"_list": Object {
"viewed": Object {
"addViewed": [Function],
"viewed": Object {
"1019155171608096768": true,
},
},
},
"attachment_guid": false,
"blurb": false,
"containerObj": undefined,
"container_guid": "activityguid0",
"custom_data": false,
"custom_type": false,
"description": "Congratulations! ",
"edited": "",
"getThumbSource": [Function],
"guid": "activityguid0",
"mature": false,
"message": "Message",
"ownerObj": Object {
"getAvatarSource": [Function],
"guid": "824853017709780997",
"subtype": false,
"time_created": "1522036284",
......@@ -63,27 +54,18 @@ exports[`Activity screen component renders correctly with an entity as param 2`]
autoHeight={false}
entity={
Object {
"_list": Object {
"viewed": Object {
"addViewed": [Function],
"viewed": Object {
"1019155171608096768": true,
},
},
},
"attachment_guid": false,
"blurb": false,
"containerObj": undefined,
"container_guid": "activityguid0",
"custom_data": false,
"custom_type": false,
"description": "Congratulations! ",
"edited": "",
"getThumbSource": [Function],
"guid": "activityguid0",
"mature": false,
"message": "Message",
"ownerObj": Object {
"getAvatarSource": [Function],
"guid": "824853017709780997",
"subtype": false,
"time_created": "1522036284",
......@@ -109,27 +91,18 @@ exports[`Activity screen component renders correctly with an entity as param 2`]
"state": Object {
"params": Object {
"entity": Object {
"_list": Object {
"viewed": Object {
"addViewed": [Function],
"viewed": Map {
"1019155171608096768" => true,
},
},
},
"attachment_guid": false,
"blurb": false,
"containerObj": undefined,
"container_guid": "activityguid0",
"custom_data": false,
"custom_type": false,
"description": "Congratulations! ",
"edited": "",
"getThumbSource": [Function],
"guid": "activityguid0",
"mature": false,
"message": "Message",
"ownerObj": Object {
"getAvatarSource": [Function],
"guid": "824853017709780997",
"subtype": false,
"time_created": "1522036284",
......@@ -161,27 +134,18 @@ exports[`Activity screen component renders correctly with an entity as param 2`]
"state": Object {
"params": Object {
"entity": Object {
"_list": Object {
"viewed": Object {
"addViewed": [Function],
"viewed": Map {
"1019155171608096768" => true,
},
},
},
"attachment_guid": false,
"blurb": false,
"containerObj": undefined,
"container_guid": "activityguid0",
"custom_data": false,
"custom_type": false,
"description": "Congratulations! ",
"edited": "",
"getThumbSource": [Function],
"guid": "activityguid0",
"mature": false,
"message": "Message",
"ownerObj": Object {
"getAvatarSource": [Function],
"guid": "824853017709780997",
"subtype": false,
"time_created": "1522036284",
......
......@@ -18,7 +18,12 @@ exports[`Owner component renders correctly 1`] = `
resizeMode="cover"
source={
Object {
"source": "http://thisisaurl",
"headers": Object {
"App-Version": "3.8.0",
"Cache-Control": "no-cache, no-store, must-revalidate",
"Pragma": "no-cache",
},
"uri": "https://cdn.minds.com/icon/824853017709780997/medium/undefined",
}
}
style={
......@@ -62,6 +67,30 @@ exports[`Owner component renders correctly 1`] = `
}
/>
</PreventDoubleTap>
<PreventDoubleTap
onPress={[Function]}
style={
Object {
"flex": 1,
"marginLeft": 4,
}
}
>
<Text
lineBreakMode="tail"
numberOfLines={1}
style={
Object {
"color": "#888",
"fontFamily": "Roboto",
"fontWeight": "bold",
}
}
>
&gt;
group
</Text>
</PreventDoubleTap>
</View>
</View>
</View>
......
......@@ -36,7 +36,12 @@ exports[`Remind owner component renders correctly 1`] = `
resizeMode="cover"
source={
Object {
"source": "http://thisisaurl",
"headers": Object {
"App-Version": "3.8.0",
"Cache-Control": "no-cache, no-store, must-revalidate",
"Pragma": "no-cache",
},
"uri": "https://cdn.minds.com/icon/824853017709780997/medium/undefined",
}
}
style={
......
import 'react-native';
import React from 'react';
import { Text, TouchableOpacity } from "react-native";
import { shallow } from 'enzyme';
import { activitiesServiceFaker } from '../../../../__mocks__/fake/ActivitiesFaker';
import renderer from 'react-test-renderer';
import RemindAction from '../../../../src/newsfeed/activity/actions/RemindAction';
import withPreventDoubleTap from '../../../../src/common/components/PreventDoubleTap';
import featuresService from '../../../../src/common/services/features.service';
import ActivityModel from '../../../../src/newsfeed/ActivityModel';
describe('Thumb action component', () => {
let screen;
beforeEach(() => {
const TouchableOpacityCustom = <TouchableOpacity onPress={this.onPress} />;
let screen, entity;
beforeEach(() => {
const navigation = { push: jest.fn(), state: {key:1} };
let activityResponse = activitiesServiceFaker().load(1);
entity = ActivityModel.create(activityResponse.activities[0])
screen = shallow(
<RemindAction entity={activityResponse.activities[0]} navigation={navigation} />
<RemindAction entity={entity} navigation={navigation} />
);
jest.runAllTimers();
});
it('renders correctly', async () => {
screen.update();
expect(screen).toMatchSnapshot();
});
it('should have a remind button', async () => {
screen.update();
expect(screen.find('PreventDoubleTap')).toHaveLength(1)
});
it('should navigate a thumb on press ', () => {
let activityResponse = activitiesServiceFaker().load(1);
const navigation = {
push: jest.fn(),
state: {key:1}
};
let entity = activityResponse.activities[0];
entity.toggleVote = jest.fn();
entity.votedUp = true;
entity['thumbs:up:user_guids'] = ['1'];
screen = shallow(
<RemindAction entity={entity} navigation={navigation}/>
);
screen.update()
let touchables = screen.find('PreventDoubleTap');
touchables.at(0).props().onPress();
jest.runAllTimers();
expect(navigation.push).toBeCalled();
});
});
\ No newline at end of file
......@@ -11,24 +11,24 @@ import ThumbDownAction from '../../../../src/newsfeed/activity/actions/ThumbDown
import withPreventDoubleTap from '../../../../src/common/components/PreventDoubleTap';
import featuresService from '../../../../src/common/services/features.service';
import UserStore from '../../../../src/auth/UserStore';
import ActivityModel from '../../../../src/newsfeed/ActivityModel';
jest.mock('../../../../src/auth/UserStore');
// prevent double tap in touchable
describe('Thumb action component', () => {
let screen;
let screen, entity;
beforeEach(() => {
const TouchableOpacityCustom = <TouchableOpacity onPress={this.onPress} />;
const navigation = { navigate: jest.fn() };
let activityResponse = activitiesServiceFaker().load(1);
entity = ActivityModel.create(activityResponse.activities[0]);
screen = shallow(
<ThumbDownAction entity={activityResponse.activities[0]} navigation={navigation} />
<ThumbDownAction entity={entity} navigation={navigation} />
);
jest.runAllTimers();
});
it('renders correctly', async () => {
......@@ -43,21 +43,21 @@ describe('Thumb action component', () => {
});
it('should navigate a thumb on press ', () => {
let activityResponse = activitiesServiceFaker().load(1);
const navigation = {
navigate: jest.fn()
const navigation = {
navigate: jest.fn()
};
let entity = activityResponse.activities[0];
entity.toggleVote = jest.fn();
entity.votedUp = true;
screen = shallow(
<ThumbDownAction entity={entity} navigation={navigation}/>
);
screen.update();
let touchables = screen.find('PreventDoubleTap');
touchables.at(0).props().onPress();
jest.runAllTimers();
expect(entity.toggleVote).toHaveBeenCalled();
......
......@@ -11,22 +11,24 @@ import ThumbUpAction from '../../../../src/newsfeed/activity/actions/ThumbUpActi
import withPreventDoubleTap from '../../../../src/common/components/PreventDoubleTap';
import featuresService from '../../../../src/common/services/features.service';
import UserStore from '../../../../src/auth/UserStore';
import ActivityModel from '../../../../src/newsfeed/ActivityModel';
jest.mock('../../../../src/auth/UserStore');
describe('Thumb action component', () => {
let screen;
let screen, entity;
beforeEach(() => {
const TouchableOpacityCustom = <TouchableOpacity onPress={this.onPress} />;
const navigation = { navigate: jest.fn() };
let activityResponse = activitiesServiceFaker().load(1);
entity = ActivityModel.create(activityResponse.activities[0]);
screen = shallow(
<ThumbUpAction entity={activityResponse.activities[0]} navigation={navigation} />
<ThumbUpAction entity={entity} navigation={navigation} />
);
jest.runAllTimers();
});
it('renders correctly', async () => {
......@@ -41,21 +43,20 @@ describe('Thumb action component', () => {
});
it('should navigate a thumb on press ', () => {
let activityResponse = activitiesServiceFaker().load(1);
const navigation = {
navigate: jest.fn()
const navigation = {
navigate: jest.fn()
};
let entity = activityResponse.activities[0];
entity.toggleVote = jest.fn();
entity.votedUp = true;
screen = shallow(
<ThumbUpAction entity={entity} navigation={navigation}/>
);
screen.update();
let touchables = screen.find('PreventDoubleTap');
touchables.at(0).props().onPress();
jest.runAllTimers();
expect(entity.toggleVote).toHaveBeenCalled();
......
......@@ -8,6 +8,12 @@ exports[`Comment action component renders correctly 1`] = `
Object {
"flex": 1,
},
Object {
"alignContent": "center",
"alignItems": "center",
"alignSelf": "center",
"justifyContent": "center",
},
Object {
"flexDirection": "row",
"justifyContent": "center",
......@@ -16,16 +22,27 @@ exports[`Comment action component renders correctly 1`] = `
}
>
<Icon
color="rgb(96, 125, 139)"
allowFontScaling={false}
name="speaker-notes-off"
raised={false}
reverse={false}
reverseColor="white"
size={20}
underlayColor="white"
style={
Array [
Object {
"color": "#d8d8d8",
},
Object {
"marginRight": 5,
},
]
}
/>
<Counter
size={15}
size={14}
style={
Object {
"color": "rgb(96, 125, 139)",
}
}
/>
</PreventDoubleTap>
`;
......@@ -3,25 +3,22 @@
exports[`Owner component renders correctly 1`] = `
<View
style={
Object {
"alignItems": "center",
"flexDirection": "column",
"justifyContent": "center",
}
Array [
Object {
"alignItems": "center",
"flexDirection": "column",
},
]
}
>
<Text
style={
Array [
Object {
"paddingLeft": 4,
},
Object {
"color": "#888",
"fontWeight": "800",
"color": "rgb(96, 125, 139)",
},
Object {
"fontSize": 11,
"fontSize": 15,
},
]
}
......
......@@ -8,26 +8,42 @@ exports[`Thumb action component renders correctly 1`] = `
Object {
"flex": 1,
},
Object {
"alignContent": "center",
"alignItems": "center",
"alignSelf": "center",
"justifyContent": "center",
},
Object {
"flexDirection": "row",
"justifyContent": "center",
},
null,
]
}
testID="Remind activity button"
>
<Icon
color="rgb(96, 125, 139)"
allowFontScaling={false}
name="repeat"
raised={false}
reverse={false}
reverseColor="white"
size={20}
underlayColor="white"
style={
Array [
Object {
"color": "rgb(96, 125, 139)",
},
Object {
"marginRight": 5,
},
]
}
/>
<Counter
size={15}
size={14}
style={
Object {
"color": "rgb(96, 125, 139)",
}
}
/>
</PreventDoubleTap>
`;
......@@ -23,16 +23,27 @@ exports[`Thumb action component renders correctly 1`] = `
testID="Thumb down activity button"
>
<Icon
color="rgb(96, 125, 139)"
allowFontScaling={false}
name="thumb-down"
raised={false}
reverse={false}
reverseColor="white"
size={20}
underlayColor="white"
style={
Array [
Object {
"color": "rgb(96, 125, 139)",
},
Object {
"marginRight": 5,
},
]
}
/>
<Counter
size={15}
size={14}
style={
Object {
"color": "rgb(96, 125, 139)",
}
}
testID="Thumb down count"
/>
</PreventDoubleTap>
......
......@@ -23,16 +23,27 @@ exports[`Thumb action component renders correctly 1`] = `
testID="Thumb up activity button"
>
<Icon
color="rgb(96, 125, 139)"
allowFontScaling={false}
name="thumb-up"
raised={false}
reverse={false}
reverseColor="white"
size={20}
underlayColor="white"
style={
Array [
Object {
"color": "rgb(96, 125, 139)",
},
Object {
"marginRight": 5,
},
]
}
/>
<Counter
size={15}
size={14}
style={
Object {
"color": "rgb(96, 125, 139)",
}
}
testID="Thumb up count"
/>
</PreventDoubleTap>
......
......@@ -7,7 +7,6 @@ import UserModel from '../../src/channel/UserModel';
jest.mock('../../src/channel/ChannelService');
jest.mock('../../src/channel/UserModel');
// mock the static create method
UserModel.create = jest.fn();
......@@ -258,8 +257,10 @@ describe('user store', () => {
const fakeUser = meFactory(1);
fakeUser.admin = true;
const entity = new UserModel(fakeUser);
// mock methods called
UserModel.create.mockReturnValue(fakeUser);
UserModel.create.mockReturnValue(entity);
try {
// set the user
......
......@@ -636,6 +636,8 @@ exports[`LoginForm component should renders correctly 1`] = `
"borderColor": "#777777",
"borderRadius": 20,
"borderWidth": 1,
"flexDirection": "row",
"justifyContent": "center",
"margin": 4,
"opacity": 1,
"padding": 4,
......@@ -673,6 +675,8 @@ exports[`LoginForm component should renders correctly 1`] = `
"borderColor": "#4690D6",
"borderRadius": 20,
"borderWidth": 1,
"flexDirection": "row",
"justifyContent": "center",
"margin": 4,
"opacity": 1,
"padding": 4,
......