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
type Auth { | |
register(username: String!, password: String!): User | |
} | |
type Query { | |
auth: Auth | |
} |
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
data={orderBy( | |
this.state.query | |
? this.state.data.filter(x => | |
Object.values(x).some(s => | |
s.toLowerCase() | |
.includes(lowerCaseQuery)) | |
) | |
: this.state.data, | |
this.state.columnToSort, | |
this.state.sortDirection |
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
GraphQLHTTP(req => { | |
console.log(req.user); | |
return { | |
schema: motobanSchema, | |
graphiql: true, | |
context: { | |
SECRET, | |
user: req.user | |
} | |
} |
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
let el; | |
await wait(() => { | |
el = queryByText("Yes") | |
return el; | |
}) | |
FireEvent.click(el); |
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
{ | |
request: { | |
query: DELETE_TAG, | |
variables: { id: "123" } | |
}, | |
result: { | |
data: { | |
deleteTag: { | |
id: "123", | |
displayName: "something" |
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
Show hidden characters
{ | |
"presets": ["@babel/preset-env"], | |
"env": { | |
"production": { | |
"plugins": [ | |
["emotion", { "hoist": true }], | |
["@babel/plugin-syntax-dynamic-import"] | |
] | |
}, | |
"development": { |
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
{ | |
// Place your snippets for typescriptreact here. Each snippet is defined under a snippet name and has a prefix, body and | |
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | |
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the | |
// same ids are connected. | |
// Example: | |
"Typescript React PureComponent": { | |
"prefix": "rpc", | |
"body": [ | |
"import * as React from 'react'", |
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 * as React from "react"; | |
import { Route } from "react-router-dom"; | |
import { fireEvent, waitForElement, wait } from "react-testing-library"; | |
import LoginConnector from "./LoginConnector"; | |
const email = "tom@tom.com"; | |
const password = "asdfasdfasdfasdf"; | |
it("testing Login Connector", () => { |
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
[ | |
"Trying out GraphQL", | |
"out GraphQL", | |
"GraphQL" | |
] |
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 { ReactTestInstance } from "react-test-renderer"; | |
export const textInTree = ( | |
root: string | ReactTestInstance, | |
text: string | |
): boolean => { | |
if (typeof root === "string") { | |
return text === root; | |
} |