Skip to content

Instantly share code, notes, and snippets.

@johnnolan
johnnolan / lpa.json
Last active November 2, 2022 14:04
ttl lpa
[
{
"@id": "http://w3id.org/lpa/",
"@type": ["http://www.w3.org/2002/07/owl#Ontology"],
"http://purl.org/dc/terms/title": [
{ "@value": "LPA ontology", "@language": "en" }
],
"http://purl.org/dc/terms/description": [
{
"@value": "The Lasting Power of Attorney ontology aims at describing the Lasting Power of Attorney document.",
@johnnolan
johnnolan / test.json
Last active September 16, 2022 13:58
testschema
{
"@context": {
"@version": 1.1,
"@protected": true,
"id": "@id",
"type": "@type",
"LastingPowerOfAttorney": {
"@id": "https://www.opg.gov.uk.org/2022/LastingPowerOfAttorney",
"@context": {
"@version": 1.1,
@johnnolan
johnnolan / tech-ethics-adr.md
Created August 18, 2022 07:57
Tech Ethics Architectural Decision Record Template

NUMBER - TITLE

Date: DATE

Status

Accepted | Proposed | Deprecated | Superseded

Context

@johnnolan
johnnolan / example-response.json
Created March 8, 2021 09:04
Performance Platform API
[
{
"_id": "MjAyMC0wNi0wMVQwMDowMDowMCswMDowMG9wZy11c2UtYW4tbHBhbW9udGh0cmFuc2FjdGlvbnNkaWdpdGFs",
"_timestamp": "2020-06-01T00:00:00+00:00",
"service": "opg-use-an-lpa",
"channel": "digital",
"count": 456,
"dataType": "transactions",
"period": "month"
},

Keybase proof

I hereby claim:

  • I am johnnolan on github.
  • I am jb_moj (https://keybase.io/jb_moj) on keybase.
  • I have a public key ASCjbGsl86fHW4BRygZIlxzatF_SluEkb1xEyuuzq_asCAo

To claim this, I am signing this object:

@johnnolan
johnnolan / JestReactHOC.js
Last active April 9, 2024 10:03
Example on how to test a React Higher Order Component using react-testing-library
import React from 'react'
import {render, cleanup} from 'react-testing-library'
// withHOC.js
function withHOC (WrappedComponent) {
render() {
return (
<main>
<section>
<h1>HOC Example</h1>
import React from "react";
import Button from "Button";
import { mountWrap } from 'contextWrap';
describe("Given the button is rendered with just a label", () => {
const data = {
label: "My Button"
}
let wrapper, aElement;
@johnnolan
johnnolan / setPropsInReduxEnzymemount.js
Last active February 11, 2019 09:19
If you want to test a Connected Component within a Provider while using Enzyme's mount and set its props to test how it renders by using something like toMatchSnapshot then you can set the props like so.
import React from "react";
import { mount } from 'enzyme';
import renderer from 'react-test-renderer'
import { Provider } from 'react-redux'
describe("Given you have a component that is wrapped in a Redux store and mount it, then you want to update the props of the child component", () => {
it('renders correctly', () => {
const mockStore = configureStore();
let store = mockStore(initialState)
let wrapper = mount(<Provider store={ store }><ConnectedComponent /></Provider>)
function hammerTime() {
var cantTouchThis = true;
var myMusic = 'makes me so hard';
debugger;
if (myMusic === 'makes me so hard') {
return cantTouchThis;
} else {
return !cantTouchThis;
}
function coolStory() {
var coolStoryBro = [
{ 'line': 'Now this is a story all about how' },
{ 'line': 'My life got flipped-turned upside down' },
{ 'line': 'And Id like to take a minute' },
{ 'line': 'Just sit right there' },
{ 'line': 'Ill tell you how I became the prince of a town called Bel-Air' }
];