Skip to content

Commit

Permalink
Merge pull request #539 from sebgroup/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
mario-subo authored Mar 10, 2021
2 parents 52d9a14 + 0ff3a2d commit ba4d2cf
Show file tree
Hide file tree
Showing 11 changed files with 161 additions and 397 deletions.
1 change: 1 addition & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./lib/coverage/lcov.info
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}

7 changes: 4 additions & 3 deletions docs/src/components/TechStack.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from "react";
import { withPrefix } from "gatsby";
import pkg from "@pkg";
import "../styles/tech-stack.scss";

Expand All @@ -16,7 +17,7 @@ export const TechStack: React.FC = React.memo(() => {
<div className="col-md-4 col-12">
<div className="img">
<a href="https://reactjs.org/" target="_blank" rel="noreferrer noopener nofollow">
<img className="img-fluid" src="/react.png" alt="React" />
<img className="img-fluid" src={withPrefix("/react.png")} alt="React" />
</a>
</div>
<h3>React</h3>
Expand All @@ -25,7 +26,7 @@ export const TechStack: React.FC = React.memo(() => {
<div className="col-md-4 col-12">
<div className="img">
<a href="https://www.typescriptlang.org/" target="_blank" rel="noreferrer noopener nofollow">
<img className="img-fluid" src="/typescript.png" alt="Typescript" />
<img className="img-fluid" src={withPrefix("/typescript.png")} alt="Typescript" />
</a>
</div>
<h3>Typescript</h3>
Expand All @@ -34,7 +35,7 @@ export const TechStack: React.FC = React.memo(() => {
<div className="col-md-4 col-12">
<div className="img">
<a href="https://sebgroup.github.io/bootstrap/" target="_blank" rel="noreferrer noopener nofollow">
<img className="img-fluid" src="/bootstrap.png" alt="Bootstrap" />
<img className="img-fluid" src={withPrefix("/bootstrap.png")} alt="Bootstrap" />
</a>
</div>
<h3>SEB Bootstrap</h3>
Expand Down
3 changes: 2 additions & 1 deletion docs/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Navbar } from "../components/Navbar";
import { Footer } from "../components/Footer";
import { TechStack } from "../components/TechStack";
import { httpGet } from "../utils/http";
import { withPrefix } from "gatsby";
import { getCommonMetaTag, initMetaConfiguration } from "../utils/meta.util";
import AccessibilityIllustration from "../../static/illustrations/accessibility.svg";
import AdjustmentsIllustration from "../../static/illustrations/adjustments.svg";
Expand All @@ -15,7 +16,7 @@ const designer: GithubContributor = {
login: "boonying",
type: "User",
html_url: "https://www.behance.net/boonying",
avatar_url: "/boonying-profile.png",
avatar_url: withPrefix("/boonying-profile.png"),
};

export default function Home() {
Expand Down
8 changes: 6 additions & 2 deletions lib/src/Carousel/Carousel.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,9 @@ describe("Component: Carousel", () => {
expect(element(0).classList.contains("carousel-item-left")).toBeFalsy();

act(() => Simulate.mouseLeave(container.firstElementChild));
act(() => jest.advanceTimersByTime(1000));
act(() => {
jest.advanceTimersByTime(1000);
});
expect(element(0).classList.contains("carousel-item-left")).toBeFalsy();

act(() => Simulate.mouseLeave(container.firstElementChild));
Expand All @@ -312,7 +314,9 @@ describe("Component: Carousel", () => {
);
});

act(() => jest.advanceTimersByTime(autoplaySpeed));
act(() => {
jest.advanceTimersByTime(autoplaySpeed);
});
expect(element(0).classList.contains("carousel-item-left")).toBeTruthy();

jest.clearAllTimers();
Expand Down
7 changes: 1 addition & 6 deletions lib/src/Datepicker/Datepicker.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,10 @@ describe("Component: Datepicker", () => {

it("Should use default locale when unknown locale code provided", () => {
act(() => {
render(<Datepicker {...props} localeCode="sl" forceCustom />, container);
render(<Datepicker {...props} localeCode="%$#^%$@" forceCustom />, container);
});

const monthElement: HTMLSelectElement = container.querySelector("select.seb-datepicker-custom-month");
expect(monthElement.querySelectorAll("option").item(0).innerHTML.toLowerCase()).toBe("mesec");

act(() => {
render(<Datepicker {...props} localeCode="%$#^%$@" forceCustom />, container);
});

expect(monthElement.querySelectorAll("option").item(0).innerHTML.toLowerCase()).toBe("month");
});
Expand Down
4 changes: 3 additions & 1 deletion lib/src/Image/Img.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ describe("Component: Image", () => {
});
});

await act(() => promise);
await act(async () => {
await promise;
});
const style: string = container.firstElementChild.getAttribute("style");
expect(style).toContain(`background-image: url(${image})`);
expect(style).toContain(`width: 1px`);
Expand Down
8 changes: 6 additions & 2 deletions lib/src/Notification/Notification.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ describe("Component: Notification", () => {
expect(notification.classList.contains("show")).toBeTruthy();
expect(notification.classList.contains("hide")).toBeFalsy();

act(() => jest.advanceTimersByTime(5000));
act(() => {
jest.advanceTimersByTime(5000);
});

expect(notification.classList.contains("show")).toBeFalsy();
expect(notification.classList.contains("hide")).toBeTruthy();
Expand Down Expand Up @@ -76,7 +78,9 @@ describe("Component: Notification", () => {
expect(notification.classList.contains("show")).toBeTruthy();
expect(notification.classList.contains("hide")).toBeFalsy();

act(() => jest.advanceTimersByTime(customTimeout));
act(() => {
jest.advanceTimersByTime(customTimeout);
});

expect(notification.classList.contains("show")).toBeFalsy();
expect(notification.classList.contains("hide")).toBeTruthy();
Expand Down
6 changes: 3 additions & 3 deletions lib/src/Tooltip/placement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export class OverlayPositionChecker {
* @returns overlay coordinate
*/
private getOverlayPositionCoord(position: ElementPosition): void {
const overlayRect: ClientRect = this.overlayElement.getBoundingClientRect();
const overlayRect: ClientRect = this.overlayElement?.getBoundingClientRect();
const selectedPlacement: ElementPlacement = elementPlacements[position];
if (selectedPlacement) {
const top: number = this.getPointPosition(selectedPlacement.y);
Expand All @@ -208,8 +208,8 @@ export class OverlayPositionChecker {
* @returns position
*/
private getPointPosition(point: PointPositionLabel): number {
const referenceRect: ClientRect = this.referenceElement.getBoundingClientRect();
const overlayRect: ClientRect = this.overlayElement.getBoundingClientRect();
const referenceRect: ClientRect = this.referenceElement?.getBoundingClientRect();
const overlayRect: ClientRect = this.overlayElement?.getBoundingClientRect();
let calculatedPosition: number = 0;
switch (point) {
case "vertical-center":
Expand Down
12 changes: 1 addition & 11 deletions lib/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,13 @@
"compilerOptions": {
"outDir": "dist",
"rootDir": "src",
"module": "esnext",
"moduleResolution": "Node",
"target": "ES5",
"lib": ["ES2015", "ES6", "ES2017", "DOM"],
"jsx": "react",
"declaration": true,
"declarationDir": "dist",
"sourceMap": true,
"importHelpers": true,
"noImplicitReturns": false,
"noImplicitThis": false,
"noImplicitAny": false,
"strictNullChecks": false,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true
},
"exclude": ["coverage", "dist"],
"types": ["typePatches"]
"exclude": ["coverage", "dist"]
}
Loading

0 comments on commit ba4d2cf

Please sign in to comment.