This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//specs | |
matrix(2) | |
[[1,2], | |
[4,3]] | |
matrix(4) | |
[[1,2,3,4], | |
[12,13,14,5], | |
[11,16,15,6], | |
[10,9,8,7]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//util | |
export default getClassesFromNode = node => { | |
const classnames = node && node.className | |
let classnames_in_string = '' | |
classnames.split(' ').forEach(v=>{ | |
classnames_in_string += '.' + v | |
}) | |
return ()=>document.querySelector(classnames_in_string) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const moment = require('moment') | |
const crypto = require('crypto') | |
exports.sign = (req, res) => { | |
const s3Config = { | |
bucket: 'assets.example.com', | |
region: 's3-ap-southeast-1', | |
keyStart: 'uploads/', | |
params: { | |
acl: 'public-read', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// variables.scss file | |
$breakpoints:( | |
sm: 640px, | |
md: 1200px, | |
lg: 1400px, | |
xl: 1900px | |
); | |
// mixins.scss file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect } from "react"; | |
import axios from "axios"; | |
import styled from "styled-components"; | |
const Loader = styled.div``; | |
const Row = styled.li` | |
list-style: none; | |
margin: 10px; | |
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default { | |
get: jest.fn().mockResolvedValue({ data: {} }) | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
setupFilesAfterEnv: ["@testing-library/react/cleanup-after-each"] | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { render, waitForElement } from "@testing-library/react"; | |
import "jest-dom/extend-expect"; | |
import axios from "axios"; | |
import Users, { url } from "./Users"; | |
test("show loader when it's fetching data, then render users' name on rows", async () => { | |
axios.get.mockResolvedValueOnce({ | |
data: { | |
results: [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { render, waitForElement } from "@testing-library/react"; | |
import "jest-dom/extend-expect"; | |
import axios from "axios"; | |
import Users, { url } from "./Users"; | |
afterEach(() => { | |
axios.get.mockClear(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const CounterHOC = ComposedComponent => | |
class extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
count: props.initCounter | |
}; | |
} |