Skip to content

Instantly share code, notes, and snippets.

View DanCassiano's full-sized avatar
🏠
Working from home

Jordan DanCassiano

🏠
Working from home
View GitHub Profile
import SwiftUI
import WebKit
import Combine
class WebViewData: ObservableObject {
@Published var loading: Bool = false
@Published var scrollPercent: Float = 0
@Published var url: URL? = nil
@Published var urlBar: String = "https://nasa.gov"
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Tronwallet-browser Example</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
import reducer, { initialState } from './../reducer';
import * as types from './../types';
describe('#Contact reducers', () => {
it('O state inicial pode ser retornado', () => {
expect(reducer(undefined, {})).toEqual(initialState);
});
it('#trySubmit', () => {
const mockedAction = {
@DanCassiano
DanCassiano / action.async.text.js
Last active April 30, 2017 00:15
Actions tests
import configureMockStore from 'redux-mock-store';
import nock from 'nock';
import thunk from 'redux-thunk';
import * as actions from './../action';
import * as types from './../types';
const middlewares = [ thunk ];
const mockStore = configureMockStore(middlewares);
import * as actions from './../action';
import * as types from './../types';
describe("#Contact Actions", ()=> {
describe("#função trySubmit", ()=> {
it('Retornar o objeto esperado', ()=> {
const anObject = actions.trySubmit();
const likeThis = {
type: types.TRY_SUBMIT
import React from 'react';
import ReactDOM from 'react-dom';
import { mount, shallow } from 'enzyme';
import sinon from 'sinon';
import From from './../components/Form';
describe("#Contact form",()=> {
const onSubmit = sinon.spy();
import * as types from './types';
export const initialState = {
msg: ''
};
export default (state = initialState, action) => {
switch (action.type) {
case types.TRY_SUBMIT:
return trySubmit(state);
import fetch from 'isomorphic-fetch';
import * as types from './types';
export function submitForm(formData) {
return dispatch => {
dispatch(trySubmit()); //tentando fazer o submit
return fetch("http://localhost:3004/contact", {
method: "POST",
headers: {
'Accept': 'application/json',
export const TRY_SUBMIT = 'TRY_SUBMIT';
export const SUBMIT_SUCCESS = 'SUBMIT_SUCCESS';
export const SUBMIT_FAILURE = 'SUBMIT_FAILURE';
@DanCassiano
DanCassiano / README-Template.md
Created April 24, 2017 15:41 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites