Skip to content

Instantly share code, notes, and snippets.

View guilherme-teodoro's full-sized avatar

Guilherme Teodoro guilherme-teodoro

View GitHub Profile
@guilherme-teodoro
guilherme-teodoro / fulcro_testing_library_test.cljs
Last active January 14, 2022 17:08
Fulcro + Testing Library + Karma Example
(ns test
(:require ["@testing-library/dom" :refer [fireEvent getByRole getByText waitFor]]
[cljs.test :refer [deftest async testing use-fixtures]]
[com.fulcrologic.fulcro.application :as app]
[com.fulcrologic.fulcro.components :as comp :refer [defsc]]
[com.fulcrologic.fulcro.dom :as dom]
[com.fulcrologic.fulcro.mutations :as m]))
(use-fixtures :each
{:before (fn []
set $mod Mod1
new_window pixel 1
new_float normal
hide_edge_borders none
bindsym $mod+u border none
bindsym $mod+y border pixel 1
bindsym $mod+n border normal
const productCardMobileMachine = Machine({
id: 'productMobileCard',
initial: 'overview',
states: {
overview: {
on: {
CONTINUE: 'closed'
},
initial: 'detailClosed',
states: {
const wizardMachine = Machine({
initial: 'identification',
context: { isEligible: false },
states: {
identification: {
on: {
NEXT: 'address'
}
},
address: {
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
const wizardMachine = Machine({
initial: 'identification',
states: {
identification: {
on: {
NEXT: 'address'
}
},
address: {
on: {
const machine = Machine({
initial: 'verde',
states: {
verde: {
on: {
PROXIMO: 'amarelo'
}
},
const toggleMachine = Machine({
id: 'vivo-controle',
initial: 'identification',
states: {
identification: {
meta: {
step: {
number: 1
},
path: '/sp/identification'
@guilherme-teodoro
guilherme-teodoro / config
Last active October 21, 2020 21:31
i3 config
set $mod Mod1
new_window pixel 1
new_float normal
hide_edge_borders none
bindsym $mod+u border none
bindsym $mod+y border pixel 1
bindsym $mod+n border normal
(ns reacao.cola)
;; primeiro examplo
(defn e
[el props & children]
(apply js/React.createElement el (clj->js props) children))
(defn mount
[]
(js/ReactDOM.render