...
 
Commits (66)
......@@ -27,11 +27,13 @@ import groupsBar from './src/groups/GroupsBarStore';
import sessionService from './src/common/services/session.service';
import logService from './src/common/services/log.service';
import SubscriptionRequestStore from './src/channel/subscription/SubscriptionRequestStore';
/**
* App stores
*/
const stores = {
subscriptionRequest: new SubscriptionRequestStore(),
newsfeed: new newsfeed(),
notifications: new notifications(),
notificationsSettings: new notificationsSettings(),
......
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';
import ActivityModel from '../../../src/newsfeed/ActivityModel';
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');
......@@ -55,7 +49,7 @@ describe('Activity screen component', () => {
}
};
entitiesService.single.mockResolvedValue(navigation.state.params.entity);
entitiesService.single.mockResolvedValue(ActivityModel.create(navigation.state.params.entity));
screen = shallow(
<ActivityScreen navigation={navigation}/>
......@@ -65,7 +59,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);
});
});
......@@ -23,27 +23,18 @@ exports[`Activity component renders correctly 1`] = `
<ThumbUpAction
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",
......@@ -72,27 +63,18 @@ exports[`Activity component renders correctly 1`] = `
<ThumbDownAction
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",
......@@ -121,7 +103,6 @@ exports[`Activity component renders correctly 1`] = `
<WireAction
owner={
Object {
"getAvatarSource": [Function],
"guid": "824853017709780997",
"subtype": false,
"time_created": "1522036284",
......@@ -132,27 +113,18 @@ exports[`Activity component renders correctly 1`] = `
<CommentsAction
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",
......@@ -176,27 +148,18 @@ exports[`Activity component renders correctly 1`] = `
<RemindAction
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",
......
......@@ -17,28 +17,25 @@ 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,
},
},
},
ActivityModel {
"__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,
"mature_visibility": false,
"message": "Message",
"ownerObj": Object {
"getAvatarSource": [Function],
"ownerObj": UserModel {
"__list": null,
"guid": "824853017709780997",
"subtype": false,
"time_created": "1522036284",
......@@ -46,10 +43,17 @@ exports[`Activity screen component renders correctly with an entity as param 2`]
},
"owner_guid": "824853017709780997",
"parent_guid": "838106762591510528",
"paywall": undefined,
"perma_url": false,
"permissions": Object {},
"pinned": undefined,
"rowKey": "something0",
"shouldBeBlured": [MockFunction],
"thumbnail_src": false,
"thumbs:down:count": undefined,
"thumbs:down:user_guids": undefined,
"thumbs:up:count": undefined,
"thumbs:up:user_guids": undefined,
"time_created": "1522036284",
"title": "TITLE",
"type": "activity",
......@@ -62,28 +66,25 @@ exports[`Activity screen component renders correctly with an entity as param 2`]
<Activity
autoHeight={false}
entity={
Object {
"_list": Object {
"viewed": Object {
"addViewed": [Function],
"viewed": Object {
"1019155171608096768": true,
},
},
},
ActivityModel {
"__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,
"mature_visibility": false,
"message": "Message",
"ownerObj": Object {
"getAvatarSource": [Function],
"ownerObj": UserModel {
"__list": null,
"guid": "824853017709780997",
"subtype": false,
"time_created": "1522036284",
......@@ -91,10 +92,17 @@ exports[`Activity screen component renders correctly with an entity as param 2`]
},
"owner_guid": "824853017709780997",
"parent_guid": "838106762591510528",
"paywall": undefined,
"perma_url": false,
"permissions": Object {},
"pinned": undefined,
"rowKey": "something0",
"shouldBeBlured": [MockFunction],
"thumbnail_src": false,
"thumbs:down:count": undefined,
"thumbs:down:user_guids": undefined,
"thumbs:up:count": undefined,
"thumbs:up:user_guids": undefined,
"time_created": "1522036284",
"title": "TITLE",
"type": "activity",
......@@ -109,27 +117,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 +160,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
......
......@@ -646,6 +646,8 @@ exports[`LoginForm component should renders correctly 1`] = `
"borderColor": "#777777",
"borderRadius": 20,
"borderWidth": 1,
"flexDirection": "row",
"justifyContent": "center",
"margin": 4,
"opacity": 1,
"padding": 4,
......@@ -685,6 +687,8 @@ exports[`LoginForm component should renders correctly 1`] = `
"borderColor": "#4690D6",
"borderRadius": 20,
"borderWidth": 1,
"flexDirection": "row",
"justifyContent": "center",
"margin": 4,
"opacity": 1,
"padding": 4,
......
......@@ -14,9 +14,7 @@ exports[`blog card component should renders correctly 1`] = `
onStartShouldSetResponder={[Function]}
style={
Object {
"backgroundColor": "#FFF",
"flex": 1,
"flexDirection": "column",
"backgroundColor": "white",
"opacity": 1,
}
}
......@@ -61,68 +59,93 @@ exports[`blog card component should renders correctly 1`] = `
</View>
<View
style={
Object {
"alignItems": "stretch",
"flexDirection": "column",
"padding": 12,
"paddingLeft": 12,
"paddingRight": 12,
"width": "100%",
}
Array [
Object {
"padding": 10,
},
]
}
>
<View
style={
Object {
"flex": 1,
"flexDirection": "row",
}
Array [
Object {
"alignItems": "flex-start",
"flexDirection": "column",
},
Object {
"width": "100%",
},
]
}
>
<View
<Text
style={
Object {
"flex": 1,
}
Array [
Object {
"fontSize": 16,
},
Object {
"fontWeight": "500",
},
]
}
>
<Text
style={
Some Title
</Text>
<View
style={
Array [
Object {
"color": "#444",
"fontFamily": "Roboto",
"fontSize": 16,
"fontWeight": "800",
"letterSpacing": 0.5,
}
}
>
Some Title
</Text>
<View
style={
"marginBottom": 10,
},
Object {
"marginTop": 10,
},
Object {
"alignItems": "center",
"alignSelf": "flex-start",
"flex": 1,
"flexDirection": "row",
"justifyContent": "center",
"paddingBottom": 4,
"paddingTop": 4,
}
},
Object {
"alignItems": "center",
},
]
}
>
<View
height={24}
style={
Array [
Object {
"backgroundColor": "transparent",
"height": 24,
"paddingBottom": 10,
"paddingRight": 10,
"paddingTop": 10,
"width": 24,
},
Object {
"borderRadius": 12,
},
undefined,
]
}
width={24}
>
<View
height={24}
style={
Array [
Object {
"backgroundColor": "transparent",
"height": 24,
"paddingBottom": 10,
"paddingRight": 10,
"paddingTop": 10,
"width": 24,
"alignItems": "center",
"alignSelf": "stretch",
"backgroundColor": "rgba(0,0,0,0.2)",
"bottom": 0,
"flex": 1,
"justifyContent": "center",
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
},
Object {
"borderRadius": 12,
......@@ -130,53 +153,40 @@ exports[`blog card component should renders correctly 1`] = `
undefined,
]
}
width={24}
>
<View
style={
Array [
Object {
"alignItems": "center",
"alignSelf": "stretch",
"backgroundColor": "rgba(0,0,0,0.2)",
"bottom": 0,
"flex": 1,
"justifyContent": "center",
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
},
Object {
"borderRadius": 12,
},
undefined,
]
}
/>
</View>
<Text
style={
/>
</View>
<Text
numberOfLines={1}
style={
Array [
Object {
"fontSize": 12,
},
Object {
"paddingLeft": 5,
},
Object {
"flex": 1,
},
]
}
>
SOMEUSERMANE
</Text>
<Text
style={
Array [
Object {
"color": "#888",
"fontSize": 10,
"paddingLeft": 8,
}
}
>
SOMEUSERMANE
</Text>
<Text
style={
},
Object {
"fontSize": 8,
"paddingLeft": 5,
}
}
>
Apr 27, 2018, 07:17
</Text>
</View>
},
]
}
>
Apr 27, 2018, 07:17
</Text>
</View>
</View>
</View>
......
......@@ -2,7 +2,6 @@ import 'react-native';
import React from 'react';
import { shallow } from 'enzyme';
import { configure } from 'mobx';
import LicensePicker from '../../src/common/components/LicensePicker';
import CaptureStore from '../../src/capture/CaptureStore';
import CapturePosterFlags from '../../src/capture/CapturePosterFlags';
import HashtagStore from '../../src/common/stores/HashtagStore';
......@@ -15,6 +14,8 @@ jest.mock('../../src/common/stores/HashtagStore');
jest.mock('../../src/capture/CaptureStore');
jest.mock('../../src/common/components/LicensePicker', () => 'LicensePicker');
jest.mock('../../src/newsfeed/topbar/TagsSubBar', () => 'TagsSubBar');
jest.mock('../../src/common/components/nsfw/NsfwToggle', () => 'NsfwToggle');
Date = class extends Date {
constructor(date) {
......
......@@ -10,7 +10,6 @@ import features from '../../src/common/services/features.service';
import renderer from 'react-test-renderer';
jest.mock('../../src/channel/ChannelStore');
jest.mock('../../src/channel/UserModel');
jest.mock('../../src/common/services/features.service');
jest.mock('../../AppStores');
jest.mock('../../src/common/services/boosted-content.service');
......@@ -19,10 +18,13 @@ jest.mock('../../src/common/services/boosted-content.service');
* Tests
*/
describe('channel actions component', () => {
let store;
beforeEach(() => {
store = new ChannelStore();
store.channel = new UserModel(userFaker(1));
store.channel.toggleSubscription = jest.fn();
store.channel.toggleBlock = jest.fn();
});
it('should renders correctly', () => {
......@@ -69,13 +71,13 @@ describe('channel actions component', () => {
store.channel.subscribed = true;
store.channel.blocked = true;
opt = wrapper.instance().makeAction(1);
opt = wrapper.instance().executeAction(1);
expect(store.channel.toggleSubscription).toBeCalled();
opt = wrapper.instance().makeAction(2);
expect(store.toggleBlock).toBeCalled();
opt = wrapper.instance().executeAction(2);
expect(store.channel.toggleBlock).toBeCalled();
opt = wrapper.instance().makeAction(3);
opt = wrapper.instance().executeAction(3);
expect(navigation.push).toBeCalled();
});
......
......@@ -3,30 +3,11 @@ import React from 'react';
import { shallow } from 'enzyme';
import ChannelScreen from '../../src/channel/ChannelScreen';
import { activitiesServiceFaker } from '../../__mocks__/fake/ActivitiesFaker';
import renderer from 'react-test-renderer';
import UserStore from '../../src/auth/UserStore';
import RewardsCarousel from '../../src/channel/carousel/RewardsCarousel';
import ChannelHeader from '../../src/channel/header/ChannelHeader';
import Toolbar from '../../src/channel/toolbar/Toolbar';
import NewsfeedList from '../../src/newsfeed/NewsfeedList';
import channelService from '../../src/channel/ChannelService';
import CenteredLoading from '../../src/common/components/CenteredLoading';
import Button from '../../src/common/components/Button';
import colors from '../../src/styles/Colors';
import BlogCard from '../../src/blogs/BlogCard';
import CaptureFab from '../../src/capture/CaptureFab';
import { CommonStyle } from '../../src/styles/Common';
import UserModel from '../../src/channel/UserModel';
import Touchable from '../../src/common/components/Touchable';
import session from '../../src/common/services/session.service';
import ChannelStore from '../../src/channel/ChannelStore';
import userFaker from '../../__mocks__/fake/channel/UserFactory'
import UserModel, { USER_MODE_CLOSED, USER_MODE_OPEN } from '../../src/channel/UserModel';
import featuresService from '../../src/common/services/features.service';
jest.mock('../../src/common/helpers/abortableFetch');
jest.mock('../../src/channel/UserModel');
jest.mock('../../src/newsfeed/ActivityModel');
jest.mock('../../src/channel/carousel/RewardsCarousel', () => 'RewardsCarousel');
jest.mock('../../src/channel/header/ChannelHeader', () => 'ChannelHeader');
......@@ -44,7 +25,7 @@ jest.mock('../../src/common/services/boosted-content.service');
*/
describe('Channel screen component', () => {
let store, screen, entities, channel, navigation, activityResponse, user;
let screen, channel, navigation, user, channelStore;
beforeEach(() => {
......@@ -53,17 +34,14 @@ describe('Channel screen component', () => {
activity.wire_totals = { tokens: 20};
activity.impressions = 20;
navigation = { navigate: jest.fn() };
navigation = { navigate: jest.fn(), goBack: jest.fn() };
navigation.state = {
params: {
entity: activity
}
};
channelStore = {
channel: {
guid:'125',
blocked: false,
},
channel: new UserModel(userFaker(1)),
setChannel: jest.fn(),
feedStore: {
setChannel: jest.fn(),
......@@ -74,16 +52,14 @@ describe('Channel screen component', () => {
load: jest.fn(),
};
user = new UserStore();
channel = { store: jest.fn() };
channel.store.mockReturnValue(channelStore);
screen = shallow(
<ChannelScreen.wrappedComponent channel={channel} user={user} navigation={navigation} />
<ChannelScreen.wrappedComponent channel={channel} navigation={navigation} />
);
screen.update();
});
it('should renders correctly', () => {
......@@ -91,8 +67,7 @@ describe('Channel screen component', () => {
expect(screen).toMatchSnapshot();
});
it('should have the expectedComponents while loading, also check newsfeed', async () => {
screen.update();
it('should have the expected components while loading, also check newsfeed', async () => {
expect(screen.find('FeedList')).toHaveLength(1);
let render = screen.dive();
......@@ -100,36 +75,42 @@ describe('Channel screen component', () => {
expect(screen.find('CaptureFab')).toHaveLength(1);
});
it('should have the expected components while loading, also check flatlist for blocked', async () => {
it('should have the expectedComponents while loading, also check flatlist for blocked', async () => {
screen.update();
channelStore = {
channel: {
guid:'125',
blocked: true,
},
setChannel: jest.fn(),
feedStore: {
setChannel: jest.fn(),
},
rewards: {
merged: []
},
load: jest.fn(),
};
user = new UserStore();
channel = { store: jest.fn() };
channelStore.channel.blocked = true;
channel.store.mockReturnValue(channelStore);
await screen.update();
screen = shallow(
<ChannelScreen.wrappedComponent channel={channel} user={user} navigation={navigation} />
);
expect(screen.find('FlatList')).toHaveLength(1);
expect(screen.find('FeedList')).toHaveLength(0);
let render = screen.dive();
expect(render.find('CenteredLoading')).toHaveLength(0);
expect(screen.find('CaptureFab')).toHaveLength(1);
});
it('should show closed channel message', async () => {
channelStore.channel.blocked = false;
channelStore.channel.mode = USER_MODE_CLOSED;
await screen.update();
expect(screen).toMatchSnapshot();
});
it('should navigate back if the the VIEW permissions are removed', async () => {
channelStore.channel.mode = USER_MODE_OPEN;
// force permissions feature flag
featuresService.features = {permissions: true};
channelStore.channel.setPermissions({permissions:[]});
await screen.update();
expect(navigation.goBack).toBeCalled();
});
});
\ No newline at end of file
......@@ -14,82 +14,6 @@ exports[`channel actions component should renders correctly 1`] = `
]
}
>
<View
accessibilityLabel="Wire Button"
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
Object {
"alignItems": "center",
"backgroundColor": "white",
"borderColor": "#4690D6",
"borderRadius": 20,
"borderWidth": 1,
"flexDirection": "row",
"justifyContent": "center",
"margin": 4,
"opacity": 1,
"padding": 4,
}
}
>
<Text
allowFontScaling={false}
style={
Array [
Object {
"color": undefined,
"fontSize": 18,
},
Array [
Object {
"marginLeft": 5,
},
Object {
"color": "#4690D6",
},
],
Object {
"fontFamily": "Ionicons",
"fontStyle": "normal",
"fontWeight": "normal",
},
Object {},
]
}
>
</Text>
<Text
style={
Array [
Object {
"color": "#4690D6",
},
Array [
Object {
"marginLeft": 5,
},
Object {
"marginRight": 5,
},
],
]
}
>
Wire
</Text>
</View>
<View
accessibilityLabel="More"
accessible={true}
......
......@@ -208,7 +208,7 @@ exports[`channel header component owner should render correctly 1`] = `
}
>
<View
accessibilityLabel="Subscribe to this channel"
accessibilityLabel="Edit your channel settings"
accessible={true}
focusable={true}
isTVSelectable={true}
......@@ -246,7 +246,7 @@ exports[`channel header component owner should render correctly 1`] = `
}
>
SUBSCRIBE
Edit
</Text>
</View>
......
......@@ -379,7 +379,17 @@ exports[`channel subscribers component should render correctly 1`] = `
style={null}
>
<DiscoveryUser
entity={
navigation={
Object {
"navigate": [MockFunction],
"state": Object {
"params": Object {
"guid": 1,
},
},
}
}
row={
Object {
"index": 0,
"item": Object {
......@@ -468,16 +478,6 @@ exports[`channel subscribers component should render correctly 1`] = `
},
}
}
navigation={
Object {
"navigate": [MockFunction],
"state": Object {
"params": Object {
"guid": 1,
},
},
}
}
store={
Object {
"filter": "subscribers",
......@@ -756,7 +756,17 @@ exports[`channel subscribers component should render correctly 1`] = `
style={null}
>
<DiscoveryUser
entity={
navigation={
Object {
"navigate": [MockFunction],
"state": Object {
"params": Object {
"guid": 1,
},
},
}
}
row={
Object {
"index": 1,
"item": Object {
......@@ -845,16 +855,6 @@ exports[`channel subscribers component should render correctly 1`] = `
},
}
}
navigation={
Object {
"navigate": [MockFunction],
"state": Object {
"params": Object {
"guid": 1,
},
},
}
}
store={
Object {
"filter": "subscribers",
......@@ -1133,7 +1133,17 @@ exports[`channel subscribers component should render correctly 1`] = `
style={null}
>
<DiscoveryUser
entity={
navigation={
Object {
"navigate": [MockFunction],
"state": Object {
"params": Object {
"guid": 1,
},
},
}
}
row={
Object {
"index": 2,
"item": Object {
......@@ -1222,16 +1232,6 @@ exports[`channel subscribers component should render correctly 1`] = `
},
}
}
navigation={
Object {
"navigate": [MockFunction],
"state": Object {
"params": Object {
"guid": 1,
},
},
}
}
store={
Object {
"filter": "subscribers",
......
import BaseModel from '../../src/common/BaseModel';
import featuresService from '../../src/common/services/features.service';
describe('base model', () => {
beforeEach(() => {
});
it('should set and validate permissions', () => {
featuresService.features = {permissions: true};
const data = {
permissions: [
'permissions1',
'permissions2',
'permissions3',
]
}
const model = new BaseModel();
model.setPermissions(data);
// should validate permissions
expect(model.can('permissions1')).toBe(true);
expect(model.can('permissions2')).toBe(true);
expect(model.can('permissions3')).toBe(true);
expect(model.can('permissions4')).toBe(false);
});
});
\ No newline at end of file
......@@ -19,6 +19,8 @@ exports[`renders correctly 1`] = `
"borderColor": "#4690D6",
"borderRadius": 20,
"borderWidth": 1,
"flexDirection": "row",
"justifyContent": "center",
"margin": 4,
"opacity": 1,
"padding": 4,
......
......@@ -22,16 +22,9 @@ exports[`Media view component renders correctly 1`] = `
<ExplicitImage
entity={
Object {
"_list": Object {
"viewed": Object {
"addViewed": [Function],
"viewed": Map {
"1019155171608096768" => true,
},
},
},
"attachment_guid": false,
"blurb": false,
"containerObj": undefined,
"container_guid": "activityguid0",
"custom_data": Array [
Object {
......@@ -61,7 +54,6 @@ exports[`Media view component renders correctly 1`] = `
"mature": false,
"message": "Message",
"ownerObj": Object {
"getAvatarSource": [Function],
"guid": "824853017709780997",
"subtype": false,
"time_created": "1522036284",
......
......@@ -46,27 +46,18 @@ exports[`newsfeed list screen component should renders correctly 1`] = `
data={
Array [
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",
......@@ -86,27 +77,18 @@ exports[`newsfeed list screen component should renders correctly 1`] = `
},
},
Object {
"_list": Object {
"viewed": Object {
"addViewed": [Function],
"viewed": Map {
"1019155171608096768" => true,
},
},
},
"attachment_guid": false,
"blurb": false,
"containerObj": undefined,
"container_guid": "activityguid1",
"custom_data": false,
"custom_type": false,
"description": "Congratulations! ",
"edited": "",
"getThumbSource": [Function],
"guid": "activityguid1",
"mature": false,
"message": "Message",
"ownerObj": Object {
"getAvatarSource": [Function],
"guid": "824853017709780997",
"subtype": false,
"time_created": "1522036284",
......@@ -126,27 +108,18 @@ exports[`newsfeed list screen component should renders correctly 1`] = `
},
},
Object {
"_list": Object {
"viewed": Object {
"addViewed": [Function],
"viewed": Map {
"1019155171608096768" => true,
},
},
},
"attachment_guid": false,
"blurb": false,
"containerObj": undefined,
"container_guid": "activityguid2",
"custom_data": false,
"custom_type": false,
"description": "Congratulations! ",
"edited": "",
"getThumbSource": [Function],
"guid": "activityguid2",
"mature": false,
"message": "Message",
"ownerObj": Object {
"getAvatarSource": [Function],
"guid": "824853017709780997",
"subtype": false,
"time_created": "1522036284",
......@@ -166,27 +139,18 @@ exports[`newsfeed list screen component should renders correctly 1`] = `
},
},
Object {
"_list": Object {
"viewed": Object {
"addViewed": [Function],
"viewed": Map {
"1019155171608096768" => true,
},
},
},
"attachment_guid": false,
"blurb": false,
"containerObj": undefined,
"container_guid": "activityguid3",
"custom_data": false,
"custom_type": false,
"description": "Congratulations! ",
"edited": "",
"getThumbSource": [Function],
"guid": "activityguid3",
"mature": false,
"message": "Message",
"ownerObj": Object {
"getAvatarSource": [Function],
"guid": "824853017709780997",
"subtype": false,
"time_created": "1522036284",
......@@ -206,27 +170,18 @@ exports[`newsfeed list screen component should renders correctly 1`] = `
},
},
Object {
"_list": Object {
"viewed": Object {
"addViewed": [Function],
"viewed": Map {
"1019155171608096768" => true,
},
},
},
"attachment_guid": false,
"blurb": false,
"containerObj": undefined,
"container_guid": "activityguid4",
"custom_data": false,
"custom_type": false,
"description": "Congratulations! ",
"edited": "",
"getThumbSource": [Function],
"guid": "activityguid4",
"mature": false,
"message": "Message",
"ownerObj": Object {
"getAvatarSource": [Function],
"guid": "824853017709780997",
"subtype": false,
"time_created": "1522036284",
......
......@@ -23,7 +23,34 @@
"externalStorage":"Minds needs access to your external storage so you can upload awesome pictures.",
"writeExternalStorage":"Minds needs access to your external storage so you can download awesome pictures.",
"sms":"Minds needs access to read sms to auto-detect the validation code.",
"camera":"Minds needs access to your external camera so you can upload awesome pictures."
"camera":"Minds needs access to your external camera so you can upload awesome pictures.",
"notAllowed":{
"appoint_admin":"You are not allowed to appoint an admin",
"appoint_moderator":"You are not allowed to appoint a moderator",
"approve_subscriber":"You are not allowed to approve a subscriber",
"create_channel":"You are not allowed to create a channel",
"create_comment":"You are not allowed to create a comment",
"create_group":"You are not allowed to create a group",
"create_post":"You are not allowed to create a post",
"delete_channel":"You are not allowed to delete this channel",
"delete_comment":"You are not allowed to delete this comment",
"delete_group":"You are not allowed to delete this group",
"delete_post":"You are not allowed to delete this post",
"edit_channel":"You are not allowed to edit this channel",
"edit_comment":"You are not allowed to edit this comment",
"edit_group":"You are not allowed to edit this group",
"edit_post":"You are not allowed to edit this post",
"invite":"You are not allowed to invite",
"join":"You are not allowed to join",
"gathering":"You are not allowed to join to this gathering",
"message":"You are not allowed to message this user",
"subscribe":"You are not allowed to subscribe",
"tag":"You are not allowed to tag this content",
"remind":"You are not allowed to remind this content",
"wire":"You are not allowed to wire this user",
"view":"You are not allowed to view this content",
"vote":"You are not allowed to vote this content"
}
},
"auth":{
"login":"LOGIN",
......@@ -185,6 +212,10 @@
"video":"Video"
},
"channel":{
"modeClosed":"Closed",
"modeOpen":"Public",
"modeModerated":"Moderated",
"isClosed":"This is a closed channel",
"channel":"channel",
"errorSaving":"Error saving channel",
"saveChanges":"Save your changes",
......@@ -194,6 +225,7 @@
"mature":"This channel contains mature content",
"confirmUnsubscribe":"Are you sure you want to unsubscribe from this channel?",
"subscribe":"Subscribe",
"requestSubscription":"Request Subscription",
"subscribed":"Subscribed",
"subscribeMessage":"Subscribe to this channel",
"unsubscribeMessage":"Unsubscribe to this channel",
......@@ -208,7 +240,9 @@
"blocked":"You have blocked @{{username}}",
"tapUnblock":"Tap to unblock",
"notFound":"Channel not found",
"viewScheduled":"Scheduled"
"viewScheduled":"Scheduled",
"requestAccepted":"Accepted",
"requestRejected":"Rejected"
},
"discovery":{
"search":"Search...",
......@@ -746,5 +780,8 @@
"noInternet":"No Internet Connection",
"offline":"Offline",
"cantReachServer":"Can't reach the server",
"showingStored":"Showing stored data"
"showingStored":"Showing stored data",
"actions":"Actions",
"requests":"Requests",
"notAllowed":"You are not allowed"
}
......@@ -28,7 +28,7 @@
"ethjs-signer": "^0.1.1",
"i18n-js": "^3.2.2",
"lodash": "^4.17.11",
"mobx": "^5.9.4",
"mobx": "^5.14.0",
"mobx-react": "^5.4.4",
"mobx-utils": "^5.4.1",
"moment": "^2.24.0",
......
......@@ -73,7 +73,7 @@ class UserStore {
}
isAdmin() {
return this.me.admin;
return this.me.isAdmin();
}
@action
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -3,7 +3,6 @@ export default {
upload: jest.fn(),
save: jest.fn(),
toggleSubscription: jest.fn(),
toggleBlock: jest.fn(),
getImageFeed: jest.fn(),
getVideoFeed: jest.fn(),
getBlogFeed: jest.fn(),
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.