add style for actor tiles

render actors got from backend
backend test code to get actors
This commit is contained in:
2020-12-11 18:23:13 +00:00
parent 707c54e5f5
commit c5d231d9f2
44 changed files with 1017 additions and 344 deletions

View File

@@ -2,6 +2,7 @@ import React from 'react';
import styles from './Tag.module.css';
import CategoryPage from '../../pages/CategoryPage/CategoryPage';
import GlobalInfos from '../../GlobalInfos';
/**
* A Component representing a single Category tag
@@ -18,18 +19,16 @@ class Tag extends React.Component {
* click handling for a Tag
*/
TagClick() {
const tag = this.props.children.toString().toLowerCase();
if (this.props.onclick) {
this.props.onclick();
this.props.onclick(tag);
return;
}
const tag = this.props.children.toString().toLowerCase();
// call callback functin to switch to category page with specified tag
this.props.viewbinding.changeRootElement(
<CategoryPage
category={tag}
viewbinding={this.props.viewbinding}/>);
GlobalInfos.getViewBinding().changeRootElement(
<CategoryPage category={tag}/>);
}
}

View File

@@ -16,14 +16,11 @@ describe('<Tag/>', function () {
});
it('click event triggered and setvideo callback called', function () {
global.fetch = global.prepareFetchApi({});
global.fetch = prepareFetchApi({});
const func = jest.fn();
const elem = {
changeRootElement: () => func()
};
prepareViewBinding(func);
const wrapper = shallow(<Tag
viewbinding={elem}>test</Tag>);
const wrapper = shallow(<Tag>test</Tag>);
expect(func).toBeCalledTimes(0);