implement full load of videos and startdata
modify api where necessary
This commit is contained in:
@@ -6,12 +6,12 @@ import {shallow} from 'enzyme';
|
||||
|
||||
describe('<Tag/>', function () {
|
||||
it('renders without crashing ', function () {
|
||||
const wrapper = shallow(<Tag tagInfo={{tag_name: 'testname', tag_id: 1}}/>);
|
||||
const wrapper = shallow(<Tag tagInfo={{TagName: 'testname', TagId: 1}}/>);
|
||||
wrapper.unmount();
|
||||
});
|
||||
|
||||
it('renders childs correctly', function () {
|
||||
const wrapper = shallow(<Tag tagInfo={{tag_name: 'test', tag_id: 1}}/>);
|
||||
const wrapper = shallow(<Tag tagInfo={{TagName: 'test', TagId: 1}}/>);
|
||||
expect(wrapper.children().text()).toBe('test');
|
||||
});
|
||||
|
||||
@@ -19,7 +19,7 @@ describe('<Tag/>', function () {
|
||||
const func = jest.fn();
|
||||
|
||||
const wrapper = shallow(<Tag
|
||||
tagInfo={{tag_name: 'test', tag_id: 1}}
|
||||
tagInfo={{TagName: 'test', TagId: 1}}
|
||||
onclick={() => {func();}}>test</Tag>);
|
||||
|
||||
expect(func).toBeCalledTimes(0);
|
||||
|
@@ -18,7 +18,7 @@ class Tag extends React.Component<props> {
|
||||
return this.renderButton();
|
||||
} else {
|
||||
return (
|
||||
<Link to={'/categories/' + this.props.tagInfo.tag_id}>
|
||||
<Link to={'/categories/' + this.props.tagInfo.TagId}>
|
||||
{this.renderButton()}
|
||||
</Link>
|
||||
);
|
||||
@@ -28,7 +28,7 @@ class Tag extends React.Component<props> {
|
||||
renderButton(): JSX.Element {
|
||||
return (
|
||||
<button className={styles.tagbtn} onClick={(): void => this.TagClick()}
|
||||
data-testid='Test-Tag'>{this.props.tagInfo.tag_name}</button>
|
||||
data-testid='Test-Tag'>{this.props.tagInfo.TagName}</button>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ class Tag extends React.Component<props> {
|
||||
TagClick(): void {
|
||||
if (this.props.onclick) {
|
||||
// call custom onclick handling
|
||||
this.props.onclick(this.props.tagInfo.tag_name); // todo check if param is neccessary
|
||||
this.props.onclick(this.props.tagInfo.TagName); // todo check if param is neccessary
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user