Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
karolkozer committed Jun 30, 2022
2 parents f9d0b8e + 7579bf0 commit dcd4b85
Show file tree
Hide file tree
Showing 13 changed files with 1,199 additions and 1,136 deletions.
14 changes: 7 additions & 7 deletions README.md
@@ -1,6 +1,6 @@
<div align="center" style="margin-bottom: 10px">
<a href="https://www.npmjs.com/package/planby">
<img src="https://raw.githubusercontent.com/karolkozer/planby/master/images/planby-logo.png" alt="Planby logo" />
<img src="https://i.postimg.cc/J0XMPHNQ/planby-logo.png" alt="Planby logo" />
</a>
</div>

Expand All @@ -22,18 +22,18 @@
Planby is a React based component for a quick implementation of Epg, schedules, live streaming, music events, timelines and many more ideas. It uses a custom virtual view which allows you to operate on a really big number of data. The component has a simple API that you can easily integrate with other third party UI libraries. The component theme is customised to the needs of the application design.

<div align="center" style="margin-bottom: 10px">
<a href="https://raw.githubusercontent.com/karolkozer/planby/master/images/planby-tv-vod.png">
<img src="https://raw.githubusercontent.com/karolkozer/planby/master/images/planby-tv-vod.png" alt="Planby preview" />
<a href="https://planby.netlify.app/">
<img src="https://i.postimg.cc/1zgmfd8T/planby-tv-vod.png" alt="Planby preview" />
</a>
</div>
<div align="center" style="margin-bottom: 10px">
<a href="https://raw.githubusercontent.com/karolkozer/planby/master/images/planby-music-festival-event.png">
<img src="https://raw.githubusercontent.com/karolkozer/planby/master/images/planby-music-festival-event.png" alt="Planby preview" />
<a href="https://planby.netlify.app/">
<img src="https://i.postimg.cc/50qZ05ST/planby-music-festival-event.png" alt="Planby preview" />
</a>
</div>
<div align="center" style="margin-bottom: 10px">
<a href="https://raw.githubusercontent.com/karolkozer/planby/master/images/planby-conf-event.png">
<img src="https://raw.githubusercontent.com/karolkozer/planby/master/images/planby-conf-event.png" alt="Planby preview" />
<a href="https://planby.netlify.app/">
<img src="https://i.postimg.cc/s2Pn9jGZ/planby-conf-event.png" alt="Planby preview" />
</a>
</div>

Expand Down
Binary file removed images/planby-banner.png
Binary file not shown.
Binary file removed images/planby-conf-event.png
Binary file not shown.
Binary file removed images/planby-logo-epg.png
Binary file not shown.
Binary file removed images/planby-logo-small.png
Binary file not shown.
Binary file removed images/planby-logo.png
Binary file not shown.
Binary file removed images/planby-music-festival-event.png
Binary file not shown.
Binary file removed images/planby-preview.png
Binary file not shown.
Binary file removed images/planby-tv-vod.png
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
@@ -1,7 +1,7 @@
{
"name": "planby",
"author": "Karol Kozer",
"version": "0.2.3",
"version": "0.3.0",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
8 changes: 5 additions & 3 deletions src/Epg/components/__tests__/Program.test.tsx
Expand Up @@ -5,7 +5,7 @@ import { subMinutes, addMinutes } from "date-fns";

test("should render and show Program component properly", () => {
const program = buildProgramWithPosition();
render(<Program program={program} />);
render(<Program isBaseTimeFormat={false} program={program} />);

expect(screen.getByText(program.data.title)).toBeInTheDocument();
expect(screen.getByLabelText(/program time/i)).toBeInTheDocument();
Expand All @@ -19,7 +19,7 @@ test("should highlight live program", () => {
const till = addMinutes(new Date(), 60);
const program = buildProgramWithPosition({ program: { since, till } });

render(<Program program={program} />);
render(<Program isBaseTimeFormat={false} program={program} />);

expect(screen.getByRole("img", { name: /preview/i })).toBeInTheDocument();
expect(screen.getByRole("img", { name: /preview/i })).toHaveAttribute(
Expand All @@ -35,7 +35,9 @@ test("should handle onClick prop", () => {
const onClick = jest.fn();
const program = buildProgramWithPosition();

render(<Program program={program} onClick={onClick} />);
render(
<Program isBaseTimeFormat={false} program={program} onClick={onClick} />
);

userEvent.click(screen.getByTestId(/program-content/i));

Expand Down
28 changes: 16 additions & 12 deletions src/Epg/helpers/__tests__/common.test.ts
@@ -1,6 +1,6 @@
import faker from '@faker-js/faker';
import { omit, getProgramOptions } from '../common';
import { buildChannel, buildProgramWithPosition } from '../../test';
import faker from "@faker-js/faker";
import { omit, getProgramOptions } from "../common";
import { buildChannel, buildProgramWithPosition } from "../../test";

function filterData(
data: Record<string, string | number | Date>,
Expand All @@ -14,25 +14,29 @@ function filterData(
}, {} as Record<string, string | number | Date>);
}

describe('Common helpers', () => {
it('should omit the keys', () => {
describe("Common helpers", () => {
it("should omit the keys", () => {
const channel = buildChannel();
const channelWithoutLogo = filterData(channel, 'logo');
expect(omit(channel, 'logo')).toEqual(channelWithoutLogo);
expect(omit(channel, 'logo')).not.toEqual(channel);
const channelWithoutLogo = filterData(channel, "logo");
expect(omit(channel, "logo")).toEqual(channelWithoutLogo);
expect(omit(channel, "logo")).not.toEqual(channel);
});

it('should get program options with position', () => {
it("should get program options with position", () => {
const options = getProgramOptions(
buildProgramWithPosition({ edgeEnd: faker.datatype.float() })
buildProgramWithPosition({
overrides: { edgeEnd: faker.datatype.float() },
})
);
const programPositionConverted = {
...options,
position: omit(options.position, 'edgeEnd'),
position: omit(options.position, "edgeEnd"),
};
expect(options).toEqual(programPositionConverted);
expect(options).not.toEqual(
buildProgramWithPosition({ edgeEnd: faker.datatype.float() })
buildProgramWithPosition({
overrides: { edgeEnd: faker.datatype.float() },
})
);
});
});

0 comments on commit dcd4b85

Please sign in to comment.