Skip to content

Instantly share code, notes, and snippets.

View fitrianij's full-sized avatar
🎯
Focusing

Fitriani fitrianij

🎯
Focusing
View GitHub Profile
@fitrianij
fitrianij / jest-enzyme-cheat-sheet.js
Last active July 5, 2020 08:56
Cheat Sheet for Jest and Enzyme
import Enzyme, { mount } from 'enzyme';
// mount a component with props
const loginProps = { title: 'Login Form' }
const loginForm = mount(<LoginPage {...loginProps} />);
// access child component based on prop key value
const passwordField = loginForm.find('FormItem').filterWhere((item => {
return item.prop('name') === 'password';
}));
@fitrianij
fitrianij / kaminari-pagination-locale.rb
Created August 22, 2015 14:22
kaminari pagination locale
en:
views:
pagination:
first: "&laquo; First"
last: "Last&raquo;"
previous: "&lsaquo; Prev"
next: "Next &rsaquo;"
truncate: "&hellip;"