level_0 int64 0 10k | index int64 0 0 | repo_id stringlengths 22 152 | file_path stringlengths 41 203 | content stringlengths 11 11.5M |
|---|---|---|---|---|
2,638 | 0 | petrpan-code/geist-org/geist-ui/components/keyboard | petrpan-code/geist-org/geist-ui/components/keyboard/__tests__/index.test.tsx | import React from 'react'
import { mount } from 'enzyme'
import { Keyboard } from 'components'
describe('Keyboard', () => {
it('should render correctly', () => {
const wrapper = mount(<Keyboard>F</Keyboard>)
expect(wrapper.html()).toMatchSnapshot()
expect(() => wrapper.unmount()).not.toThrow()
})
i... |
2,639 | 0 | petrpan-code/geist-org/geist-ui/components/keyboard/__tests__ | petrpan-code/geist-org/geist-ui/components/keyboard/__tests__/__snapshots__/index.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Keyboard should render correctly 1`] = `
"<kbd class=\\"\\"><span>F</span><style>
kbd {
line-height: 2em;
text-align: center;
display: inline-block;
color: #666;
background-color: #fafafa;
font-famil... |
2,643 | 0 | petrpan-code/geist-org/geist-ui/components/link | petrpan-code/geist-org/geist-ui/components/link/__tests__/index.test.tsx | import React from 'react'
import { mount } from 'enzyme'
import { Link } from 'components'
describe('Link', () => {
it('should render correctly', () => {
const wrapper = mount(
<div>
<Link href="https://geist-ui.dev">link</Link>
<Link href="https://geist-ui.dev" color>
link
... |
2,644 | 0 | petrpan-code/geist-org/geist-ui/components/link/__tests__ | petrpan-code/geist-org/geist-ui/components/link/__tests__/__snapshots__/index.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Link should render correctly 1`] = `
"<div><a class=\\"link\\" href=\\"https://geist-ui.dev\\">link<style>
.link {
display: inline-flex;
align-items: baseline;
line-height: inherit;
color: inherit;
... |
2,647 | 0 | petrpan-code/geist-org/geist-ui/components/loading | petrpan-code/geist-org/geist-ui/components/loading/__tests__/index.test.tsx | import React from 'react'
import { mount } from 'enzyme'
import { Loading } from 'components'
describe('Loading', () => {
it('should render correctly', () => {
const wrapper = mount(<Loading />)
expect(wrapper.html()).toMatchSnapshot()
expect(() => wrapper.unmount()).toMatchSnapshot()
})
it('should ... |
2,648 | 0 | petrpan-code/geist-org/geist-ui/components/loading/__tests__ | petrpan-code/geist-org/geist-ui/components/loading/__tests__/__snapshots__/index.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Loading should render correctly 1`] = `
"<div class=\\"loading-container\\"><span class=\\"loading\\"><i></i><i></i><i></i></span><style>
.loading-container {
display: inline-flex;
align-items: center;
position: relative;
... |
2,658 | 0 | petrpan-code/geist-org/geist-ui/components/modal | petrpan-code/geist-org/geist-ui/components/modal/__tests__/index.test.tsx | import React from 'react'
import { mount } from 'enzyme'
import { Modal } from 'components'
import { nativeEvent, updateWrapper } from 'tests/utils'
import {
expectModalIsClosed,
expectModalIsOpened,
} from '../../use-modal/__tests__/use-modal.test'
import userEvent from '@testing-library/user-event'
describe('Mod... |
2,659 | 0 | petrpan-code/geist-org/geist-ui/components/modal/__tests__ | petrpan-code/geist-org/geist-ui/components/modal/__tests__/__snapshots__/index.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Modal customization should be supported 1`] = `
"<div class=\\"wrapper test-class wrapper-enter\\" role=\\"dialog\\" tabindex=\\"-1\\"><div tabindex=\\"0\\" class=\\"hide-tab\\" aria-hidden=\\"true\\"></div><h2 class=\\"\\">Modal</h2><style>
h2 {
l... |
2,662 | 0 | petrpan-code/geist-org/geist-ui/components/note | petrpan-code/geist-org/geist-ui/components/note/__tests__/index.test.tsx | import React from 'react'
import { mount } from 'enzyme'
import { Note } from 'components'
import { updateWrapper } from 'tests/utils'
describe('Note', () => {
it('should render correctly', () => {
const wrapper = mount(<Note>note</Note>)
expect(wrapper.html()).toMatchSnapshot()
expect(() => wrapper.unmo... |
2,663 | 0 | petrpan-code/geist-org/geist-ui/components/note/__tests__ | petrpan-code/geist-org/geist-ui/components/note/__tests__/__snapshots__/index.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Note should render correctly 1`] = `
"<div class=\\"note\\"><span class=\\"label\\"><b>note:</b></span>note<style>
.note {
line-height: 1.8;
border: 1px solid #eaeaea;
color: #000;
background-color: #fff;
bord... |
2,669 | 0 | petrpan-code/geist-org/geist-ui/components/page | petrpan-code/geist-org/geist-ui/components/page/__tests__/child.test.tsx | import React from 'react'
import { mount } from 'enzyme'
import { Page } from 'components'
describe('PageChild', () => {
it('the component Page.Content should be injected automatically', () => {
const wrapper = mount(<Page>test-value</Page>)
const content = mount(
<Page>
<Page.Content>test-valu... |
2,670 | 0 | petrpan-code/geist-org/geist-ui/components/page | petrpan-code/geist-org/geist-ui/components/page/__tests__/index.test.tsx | import React from 'react'
import ReactDom from 'react-dom/server'
import { mount } from 'enzyme'
import { Page, GeistProvider } from 'components'
describe('Page', () => {
it('should render correctly', () => {
const wrapper = mount(<Page>test-value</Page>)
expect(wrapper.text()).toContain('test-value')
ex... |
2,671 | 0 | petrpan-code/geist-org/geist-ui/components/page/__tests__ | petrpan-code/geist-org/geist-ui/components/page/__tests__/__snapshots__/child.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`PageChild should work with child component 1`] = `
"<section>outside string<header class=\\"\\">header<style>
header {
font-size: calc(1 * 16px);
width: 100%;
height: auto;
padding: 0 0 0 0;
margin: 0 0 0 0;
... |
2,672 | 0 | petrpan-code/geist-org/geist-ui/components/page/__tests__ | petrpan-code/geist-org/geist-ui/components/page/__tests__/__snapshots__/index.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Page should render correctly 1`] = `
"<section><main class=\\"\\">test-value<style>
main {
font-size: calc(1 * 16px);
width: 100%;
height: 100%;
padding: calc(3.125 * 16px) 0 calc(3.125 * 16px) 0;
margin: 0 0 ... |
2,681 | 0 | petrpan-code/geist-org/geist-ui/components/pagination | petrpan-code/geist-org/geist-ui/components/pagination/__tests__/pagination.test.tsx | import React from 'react'
import { mount } from 'enzyme'
import { Pagination } from 'components'
import { act } from 'react-dom/test-utils'
import { updateWrapper } from 'tests/utils'
describe('Pagination', () => {
it('should render correctly', () => {
const wrapper = mount(<Pagination />)
expect(wrapper.htm... |
2,682 | 0 | petrpan-code/geist-org/geist-ui/components/pagination/__tests__ | petrpan-code/geist-org/geist-ui/components/pagination/__tests__/__snapshots__/pagination.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Pagination should render correctly 1`] = `
"<nav class=\\"\\"><li><button class=\\"disabled\\">prev</button><style>
li {
margin-right: 0.428em;
display: inline-block;
}
button {
border: none;
display: in... |
2,687 | 0 | petrpan-code/geist-org/geist-ui/components/popover | petrpan-code/geist-org/geist-ui/components/popover/__tests__/index.test.tsx | import React from 'react'
import { mount, ReactWrapper } from 'enzyme'
import { Popover } from 'components'
import { nativeEvent, updateWrapper } from 'tests/utils'
const expectPopoverIsShow = (wrapper: ReactWrapper) => {
expect(wrapper.find('.inner').length).not.toBe(0)
}
const expectPopoverIsHidden = (wrapper: Re... |
2,688 | 0 | petrpan-code/geist-org/geist-ui/components/popover/__tests__ | petrpan-code/geist-org/geist-ui/components/popover/__tests__/__snapshots__/index.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Popover should render react-node 1`] = `
"<div class=\\"tooltip\\"><div></div><style>
:global(.tooltip-content.popover > .inner) {
padding: calc(0.9 * 16px) 0 calc(0.9 * 16px) 0;
}
</style><style>
.tooltip {
w... |
2,691 | 0 | petrpan-code/geist-org/geist-ui/components/progress | petrpan-code/geist-org/geist-ui/components/progress/__tests__/index.test.tsx | import React from 'react'
import { mount } from 'enzyme'
import { Progress } from 'components'
describe('Progress', () => {
it('should render correctly', () => {
const wrapper = mount(<Progress value={59} />)
expect(wrapper.html()).toMatchSnapshot()
expect(() => wrapper.unmount()).not.toThrow()
})
i... |
2,692 | 0 | petrpan-code/geist-org/geist-ui/components/progress/__tests__ | petrpan-code/geist-org/geist-ui/components/progress/__tests__/__snapshots__/index.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Progress should be render background-color with color prop 1`] = `
"<div class=\\"progress\\"><div class=\\"inner\\" title=\\"59%\\"></div><progress class=\\"\\" value=\\"59\\" max=\\"100\\"></progress><style>
progress {
position: fixed;
t... |
2,699 | 0 | petrpan-code/geist-org/geist-ui/components/radio | petrpan-code/geist-org/geist-ui/components/radio/__tests__/group.test.tsx | import React from 'react'
import { mount } from 'enzyme'
import { Radio } from 'components'
import { nativeEvent } from 'tests/utils'
describe('Radio Group', () => {
it('should render correctly', () => {
const wrapper = mount(
<div>
<Radio.Group value="1">
<Radio value="1">1</Radio>
... |
2,700 | 0 | petrpan-code/geist-org/geist-ui/components/radio | petrpan-code/geist-org/geist-ui/components/radio/__tests__/index.test.tsx | import React from 'react'
import { mount } from 'enzyme'
import { Radio } from 'components'
import { nativeEvent } from 'tests/utils'
describe('Radio', () => {
it('should render correctly', () => {
const wrapper = mount(<Radio checked={false}>Option</Radio>)
expect(wrapper.html()).toMatchSnapshot()
expec... |
2,701 | 0 | petrpan-code/geist-org/geist-ui/components/radio/__tests__ | petrpan-code/geist-org/geist-ui/components/radio/__tests__/__snapshots__/group.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Radio Group should render correctly 1`] = `
"<div><div class=\\"radio-group\\"><div class=\\"radio\\"><label><input type=\\"radio\\" value=\\"1\\"><span class=\\"name\\"><span class=\\"point active\\"></span>1</span></label><style>
input {
opacity: ... |
2,702 | 0 | petrpan-code/geist-org/geist-ui/components/radio/__tests__ | petrpan-code/geist-org/geist-ui/components/radio/__tests__/__snapshots__/index.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Radio should render correctly 1`] = `
"<div class=\\"radio\\"><label><input type=\\"radio\\" value=\\"\\"><span class=\\"name\\"><span class=\\"point\\"></span>Option</span></label><style>
input {
opacity: 0;
visibility: hidden;
... |
2,706 | 0 | petrpan-code/geist-org/geist-ui/components/rating | petrpan-code/geist-org/geist-ui/components/rating/__tests__/index.test.tsx | import React, { useState } from 'react'
import { Rating } from 'components'
import { mount } from 'enzyme'
import { nativeEvent } from 'tests/utils'
describe('Rating', () => {
it('should render correctly', () => {
const wrapper = mount(<Rating />)
expect(wrapper.html()).toMatchSnapshot()
expect(() => wra... |
2,707 | 0 | petrpan-code/geist-org/geist-ui/components/rating/__tests__ | petrpan-code/geist-org/geist-ui/components/rating/__tests__/__snapshots__/index.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Rating should render correctly 1`] = `
"<div class=\\"rating\\"><div class=\\"icon-box hovered\\"><svg viewBox=\\"0 0 24 24\\" width=\\"24\\" height=\\"24\\" stroke=\\"currentColor\\" stroke-width=\\"1.5\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\" fill=... |
2,710 | 0 | petrpan-code/geist-org/geist-ui/components/row | petrpan-code/geist-org/geist-ui/components/row/__tests__/index.test.tsx | import React from 'react'
import { mount } from 'enzyme'
import Row from '../index'
import Col from '../../col'
describe('Row', () => {
it('should render correctly', () => {
const wrapper = mount(<Row>row</Row>)
expect(wrapper.html()).toMatchSnapshot()
expect(() => wrapper.unmount()).not.toThrow()
})
... |
2,711 | 0 | petrpan-code/geist-org/geist-ui/components/row/__tests__ | petrpan-code/geist-org/geist-ui/components/row/__tests__/__snapshots__/index.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Row should render correctly 1`] = `
"<div class=\\"row \\">row<style>
.row {
display: flex;
position: relative;
box-sizing: border-box;
margin-left: calc(0 * 16pt / 2);
margin-right: calc(0 * 16pt / 2);
... |
2,722 | 0 | petrpan-code/geist-org/geist-ui/components/select | petrpan-code/geist-org/geist-ui/components/select/__tests__/events.test.tsx | import React from 'react'
import { mount } from 'enzyme'
import { Select } from 'components'
import { nativeEvent, updateWrapper } from 'tests/utils'
describe('Select Events', () => {
let container: HTMLDivElement
beforeEach(() => {
container = document.createElement('div')
document.body.append(container)... |
2,723 | 0 | petrpan-code/geist-org/geist-ui/components/select | petrpan-code/geist-org/geist-ui/components/select/__tests__/index.test.tsx | import React from 'react'
import { mount, render } from 'enzyme'
import { Select } from 'components'
import { nativeEvent, updateWrapper } from 'tests/utils'
describe('Select', () => {
it('should render correctly', () => {
const wrapper = mount(
<div>
<Select />
<Select scale={2} />
<... |
2,724 | 0 | petrpan-code/geist-org/geist-ui/components/select | petrpan-code/geist-org/geist-ui/components/select/__tests__/multiple.test.tsx | import React from 'react'
import { mount } from 'enzyme'
import { Select } from 'components'
import { nativeEvent, updateWrapper } from 'tests/utils'
describe('Select Multiple', () => {
it('should render correctly', () => {
const wrapper = mount(
<Select multiple>
<Select.Option value="1">1</Select... |
2,725 | 0 | petrpan-code/geist-org/geist-ui/components/select/__tests__ | petrpan-code/geist-org/geist-ui/components/select/__tests__/__snapshots__/index.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Select should render correctly 1`] = `
"<div><div class=\\"select\\"><input type=\\"search\\" role=\\"combobox\\" aria-haspopup=\\"listbox\\" readonly=\\"\\" unselectable=\\"on\\" aria-expanded=\\"false\\"><style>
input {
position: fixed;
... |
2,726 | 0 | petrpan-code/geist-org/geist-ui/components/select/__tests__ | petrpan-code/geist-org/geist-ui/components/select/__tests__/__snapshots__/multiple.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Select Multiple should render correctly 1`] = `
"<div class=\\"select multiple\\"><input type=\\"search\\" role=\\"combobox\\" aria-haspopup=\\"listbox\\" readonly=\\"\\" unselectable=\\"on\\" aria-expanded=\\"false\\"><style>
input {
position: ... |
2,733 | 0 | petrpan-code/geist-org/geist-ui/components/shared | petrpan-code/geist-org/geist-ui/components/shared/__tests__/backdrop.test.tsx | import React from 'react'
import { mount } from 'enzyme'
import Backdrop from '../backdrop'
import { nativeEvent, updateWrapper } from 'tests/utils'
describe('Backdrop', () => {
it('should render correctly', () => {
const wrapper = mount(
<Backdrop visible>
<span>test-value</span>
</Backdrop>... |
2,734 | 0 | petrpan-code/geist-org/geist-ui/components/shared | petrpan-code/geist-org/geist-ui/components/shared/__tests__/dropdown.test.tsx | import React, { useRef } from 'react'
import { mount } from 'enzyme'
import Dropdown from '../dropdown'
import { nativeEvent, updateWrapper } from 'tests/utils'
import { act } from 'react-dom/test-utils'
const simulateGlobalClick = () => {
document.body.dispatchEvent(
new MouseEvent('click', {
view: window... |
2,735 | 0 | petrpan-code/geist-org/geist-ui/components/shared | petrpan-code/geist-org/geist-ui/components/shared/__tests__/ellipsis.test.tsx | import React from 'react'
import { mount } from 'enzyme'
import Ellipsis from '../ellipsis'
describe('Ellipsis', () => {
it('should render correctly', () => {
const wrapper = mount(
<div style={{ width: '1px' }}>
<Ellipsis height="10px">text</Ellipsis>
</div>,
)
expect(wrapper.html())... |
2,736 | 0 | petrpan-code/geist-org/geist-ui/components/shared | petrpan-code/geist-org/geist-ui/components/shared/__tests__/transition.test.tsx | import React from 'react'
import { mount } from 'enzyme'
import CssTransition from '../css-transition'
import { updateWrapper } from 'tests/utils'
describe('CssTransition', () => {
it('should render correctly', () => {
const wrapper = mount(
<CssTransition visible>
<span>test</span>
</CssTran... |
2,737 | 0 | petrpan-code/geist-org/geist-ui/components/shared/__tests__ | petrpan-code/geist-org/geist-ui/components/shared/__tests__/__snapshots__/backdrop.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Backdrop should render correctly 1`] = `
"<div class=\\"backdrop backdrop-wrapper-enter\\"><div class=\\"layer\\"></div><div class=\\"position\\"><span>test-value</span></div><style>
.backdrop {
position: fixed;
top: 0;
... |
2,738 | 0 | petrpan-code/geist-org/geist-ui/components/shared/__tests__ | petrpan-code/geist-org/geist-ui/components/shared/__tests__/__snapshots__/dropdown.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Dropdown should render correctly 1`] = `"<div></div>"`;
|
2,739 | 0 | petrpan-code/geist-org/geist-ui/components/shared/__tests__ | petrpan-code/geist-org/geist-ui/components/shared/__tests__/__snapshots__/ellipsis.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Ellipsis should render correctly 1`] = `
"<div style=\\"width: 1px;\\"><span>text<style>
span {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
line-height: 10px;
min-width: 0;
}
... |
2,740 | 0 | petrpan-code/geist-org/geist-ui/components/shared/__tests__ | petrpan-code/geist-org/geist-ui/components/shared/__tests__/__snapshots__/transition.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`CssTransition should render correctly 1`] = `"<span class=\\"undefined transition-enter\\">test</span>"`;
|
2,746 | 0 | petrpan-code/geist-org/geist-ui/components/slider | petrpan-code/geist-org/geist-ui/components/slider/__tests__/index.test.tsx | import React from 'react'
import { mount } from 'enzyme'
import { Slider } from 'components'
import { nativeEvent, updateWrapper } from 'tests/utils'
import { act } from 'react-dom/test-utils'
const triggerDrag = (el: HTMLElement, x = 0) => {
window.Element.prototype.getBoundingClientRect = () =>
({
width:... |
2,747 | 0 | petrpan-code/geist-org/geist-ui/components/slider/__tests__ | petrpan-code/geist-org/geist-ui/components/slider/__tests__/__snapshots__/index.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Slider should render correctly 1`] = `
"<div class=\\"slider\\"><div class=\\"dot\\">20<style>
.dot {
position: absolute;
left: 20%;
top: 50%;
transform: translate(-50%, -50%);
height: calc(var(--s... |
2,752 | 0 | petrpan-code/geist-org/geist-ui/components/snippet | petrpan-code/geist-org/geist-ui/components/snippet/__tests__/index.test.tsx | import React from 'react'
import { mount } from 'enzyme'
import { Snippet } from 'components'
const command = 'yarn add @geist-ui/core'
const multiLine = ['cd project', 'now']
describe('Snippet', () => {
beforeAll(() => {
window.getSelection = jest.fn().mockImplementation(() => ({
removeAllRanges: jest.fn... |
2,753 | 0 | petrpan-code/geist-org/geist-ui/components/snippet/__tests__ | petrpan-code/geist-org/geist-ui/components/snippet/__tests__/__snapshots__/index.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Snippet should render correctly 1`] = `
"<div class=\\"snippet\\"><pre>yarn add @geist-ui/core</pre><div class=\\"copy\\"><svg viewBox=\\"0 0 24 24\\" stroke=\\"currentColor\\" stroke-width=\\"1.5\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\" fill=\\"none... |
2,756 | 0 | petrpan-code/geist-org/geist-ui/components/spacer | petrpan-code/geist-org/geist-ui/components/spacer/__tests__/index.test.tsx | import React from 'react'
import { mount } from 'enzyme'
import { Spacer } from 'components'
describe('Spacer', () => {
it('should render correctly', () => {
const wrapper = mount(<Spacer />)
expect(wrapper.html()).toMatchSnapshot()
expect(() => wrapper.unmount()).not.toThrow()
})
it('should support... |
2,757 | 0 | petrpan-code/geist-org/geist-ui/components/spacer/__tests__ | petrpan-code/geist-org/geist-ui/components/spacer/__tests__/__snapshots__/index.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Spacer should render correctly 1`] = `
"<span class=\\"\\"><style>
span {
display: block;
width: calc(1 * 16px);
height: calc(1 * 16px);
padding: 0 0 0 0;
margin: 0 0 0 0;
}
</style></span>"
`;
... |
2,760 | 0 | petrpan-code/geist-org/geist-ui/components/spinner | petrpan-code/geist-org/geist-ui/components/spinner/__tests__/index.test.tsx | import React from 'react'
import { mount } from 'enzyme'
import { Spinner } from 'components'
describe('Spacer', () => {
it('should render correctly', () => {
const wrapper = mount(<Spinner />)
expect(wrapper.html()).toMatchSnapshot()
expect(() => wrapper.unmount()).not.toThrow()
})
it('should work ... |
2,761 | 0 | petrpan-code/geist-org/geist-ui/components/spinner/__tests__ | petrpan-code/geist-org/geist-ui/components/spinner/__tests__/__snapshots__/index.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Spacer should render correctly 1`] = `
"<div class=\\"spinner\\"><div class=\\"container\\"><span><style>
span {
background-color: #000;
position: absolute;
top: -3.9%;
width: 24%;
height: 8%;
left: ... |
2,770 | 0 | petrpan-code/geist-org/geist-ui/components/table | petrpan-code/geist-org/geist-ui/components/table/__tests__/index.test.tsx | import React from 'react'
import { mount } from 'enzyme'
import { Table, Code } from 'components'
import { nativeEvent, updateWrapper } from 'tests/utils'
import { act } from 'react-dom/test-utils'
import { TableColumnRender } from '../table-types'
const data = [
{ property: 'type', description: 'Content type', defa... |
2,771 | 0 | petrpan-code/geist-org/geist-ui/components/table/__tests__ | petrpan-code/geist-org/geist-ui/components/table/__tests__/__snapshots__/index.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Table should be no erros when width is too large 1`] = `
"<table class=\\"\\"><colgroup></colgroup><thead><tr><th class=\\"\\"><div class=\\"thead-box\\">property</div></th><th class=\\"\\"><div class=\\"thead-box\\">description</div></th><th class=\\"\\"><div class=... |
2,776 | 0 | petrpan-code/geist-org/geist-ui/components/tabs | petrpan-code/geist-org/geist-ui/components/tabs/__tests__/index.test.tsx | import React from 'react'
import { mount } from 'enzyme'
import { Tabs } from 'components'
import { nativeEvent, updateWrapper } from 'tests/utils'
describe('Tabs', () => {
it('should render correctly', () => {
const wrapper = mount(
<Tabs>
<Tabs.Item label="label1" value="1">
1
<... |
2,777 | 0 | petrpan-code/geist-org/geist-ui/components/tabs/__tests__ | petrpan-code/geist-org/geist-ui/components/tabs/__tests__/__snapshots__/index.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Tabs should hide border on active 1`] = `
"<div class=\\"tabs\\"><header><div class=\\"highlight\\"><style>
.highlight {
background: #eaeaea;
position: absolute;
border-radius: 5px;
width: 0px;
left: -1000px;
... |
2,780 | 0 | petrpan-code/geist-org/geist-ui/components/tag | petrpan-code/geist-org/geist-ui/components/tag/__tests__/index.test.tsx | import React from 'react'
import { mount, render } from 'enzyme'
import { Tag } from 'components'
describe('Tag', () => {
it('should render correctly', () => {
const wrapper = mount(<Tag>tag</Tag>)
expect(() => wrapper.unmount()).not.toThrow()
})
it('should work with types', () => {
const wrapper = ... |
2,781 | 0 | petrpan-code/geist-org/geist-ui/components/tag/__tests__ | petrpan-code/geist-org/geist-ui/components/tag/__tests__/__snapshots__/index.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Tag should work with invert 1`] = `
LoadedCheerio {
"0": Node {
"attribs": Object {
"class": "",
},
"children": Array [
Node {
"data": "success",
"next": Node {
"attribs": Object {},
"children": Array [
... |
2,785 | 0 | petrpan-code/geist-org/geist-ui/components/text | petrpan-code/geist-org/geist-ui/components/text/__tests__/index.test.tsx | import React from 'react'
import { mount } from 'enzyme'
import { Text } from 'components'
describe('Text', () => {
it('should render P element in the default', () => {
const wrapper = mount(<Text>test-value</Text>)
expect(wrapper.find('p')).not.toBe(0)
expect(wrapper.html()).toMatchSnapshot()
expect... |
2,786 | 0 | petrpan-code/geist-org/geist-ui/components/text/__tests__ | petrpan-code/geist-org/geist-ui/components/text/__tests__/__snapshots__/index.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Text should be able to specify the size of text 1`] = `
"<p class=\\"font\\">test-value<style>
p {
color: inherit;
width: auto;
height: auto;
}
.font {
font-size: calc(14 * 16px);
}
.mx {... |
2,789 | 0 | petrpan-code/geist-org/geist-ui/components/textarea | petrpan-code/geist-org/geist-ui/components/textarea/__tests__/index.test.tsx | import React from 'react'
import { mount } from 'enzyme'
import { Textarea } from 'components'
import { nativeEvent } from 'tests/utils'
describe('Textarea', () => {
it('should render correctly', () => {
const wrapper = mount(<Textarea placeholder="placeholder" />)
expect(wrapper.html()).toMatchSnapshot()
... |
2,790 | 0 | petrpan-code/geist-org/geist-ui/components/textarea/__tests__ | petrpan-code/geist-org/geist-ui/components/textarea/__tests__/__snapshots__/index.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Textarea should render correctly 1`] = `
"<div class=\\"wrapper\\"><textarea placeholder=\\"placeholder\\"></textarea><style>
.wrapper {
display: inline-flex;
box-sizing: border-box;
user-select: none;
border-... |
2,800 | 0 | petrpan-code/geist-org/geist-ui/components/toggle | petrpan-code/geist-org/geist-ui/components/toggle/__tests__/index.test.tsx | import React from 'react'
import { mount, ReactWrapper } from 'enzyme'
import { Toggle } from 'components'
import { nativeEvent, updateWrapper } from 'tests/utils'
const expectToggleIsChecked = (wrapper: ReactWrapper) => {
expect(wrapper.find('.checked').length).not.toBe(0)
}
const expectToggleIsUnChecked = (wrappe... |
2,801 | 0 | petrpan-code/geist-org/geist-ui/components/toggle/__tests__ | petrpan-code/geist-org/geist-ui/components/toggle/__tests__/__snapshots__/index.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Toggle should render correctly 1`] = `
"<label class=\\"\\"><input type=\\"checkbox\\"><div class=\\"toggle\\"><span class=\\"inner\\"></span></div><style>
label {
-webkit-tap-highlight-color: transparent;
display: inline-block;
... |
2,809 | 0 | petrpan-code/geist-org/geist-ui/components/tooltip | petrpan-code/geist-org/geist-ui/components/tooltip/__test__/index.test.tsx | import React from 'react'
import { mount, ReactWrapper } from 'enzyme'
import { Button, Tooltip, GeistProvider } from 'components'
import { nativeEvent, updateWrapper } from 'tests/utils'
import { act } from 'react-dom/test-utils'
const expectTooltipIsShow = (wrapper: ReactWrapper) => {
expect(wrapper.find('.inner')... |
2,820 | 0 | petrpan-code/geist-org/geist-ui/components/tree | petrpan-code/geist-org/geist-ui/components/tree/__tests__/index.test.tsx | import React from 'react'
import { mount } from 'enzyme'
import { Tree } from 'components'
import { nativeEvent } from 'tests/utils'
import { TreeFile } from '../tree'
const mockFiles: Array<TreeFile> = [
{
type: 'file',
name: 'cs.js',
},
{
type: 'directory',
name: 'bin',
files: [
{
... |
2,821 | 0 | petrpan-code/geist-org/geist-ui/components/tree/__tests__ | petrpan-code/geist-org/geist-ui/components/tree/__tests__/__snapshots__/index.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Tree should mount correctly 1`] = `
<GeistTreeFile
className=""
level={0}
name="package.json"
parentPath=""
/>
`;
exports[`Tree should mount correctly 2`] = `
<GeistTreeFolder
className=""
level={0}
name="components"
parentPath=""
/>
`;
exports[`Tre... |
2,826 | 0 | petrpan-code/geist-org/geist-ui/components/use-body-scroll | petrpan-code/geist-org/geist-ui/components/use-body-scroll/__tests__/body-scroll.test.tsx | import React, { RefObject } from 'react'
import { useBodyScroll } from 'components'
import { act, renderHook } from '@testing-library/react-hooks'
import { sleep } from 'tests/utils'
describe('UseBodyScroll', () => {
it('should work correctly', () => {
const ref = React.createRef<HTMLDivElement>()
;(ref as a... |
2,829 | 0 | petrpan-code/geist-org/geist-ui/components/use-classes | petrpan-code/geist-org/geist-ui/components/use-classes/__tests__/index.test.tsx | import { useClasses } from 'components'
import { expect } from '@jest/globals'
describe('useClasses', () => {
it('should be return string always', () => {
const str = Math.random().toString()
expect(typeof useClasses(str)).toEqual('string')
expect(typeof useClasses(true)).toEqual('string')
expect(typ... |
2,832 | 0 | petrpan-code/geist-org/geist-ui/components/use-click-away | petrpan-code/geist-org/geist-ui/components/use-click-away/__tests__/click-away.test.tsx | import React from 'react'
import { renderHook } from '@testing-library/react-hooks'
import { useClickAway } from 'components'
const simulateNativeClick = (el: Element) => {
el.dispatchEvent(
new MouseEvent('click', {
view: window,
bubbles: true,
cancelable: true,
}),
)
}
describe('UseCli... |
2,835 | 0 | petrpan-code/geist-org/geist-ui/components/use-clipboard | petrpan-code/geist-org/geist-ui/components/use-clipboard/__tests__/clipboard.test.tsx | import { useClipboard } from 'components'
import { renderHook } from '@testing-library/react-hooks'
describe('UseClipboard', () => {
beforeAll(() => {
window.getSelection = jest.fn().mockImplementation(() => ({
removeAllRanges: jest.fn(),
addRange: jest.fn(),
}))
document.createRange = jest.f... |
2,838 | 0 | petrpan-code/geist-org/geist-ui/components/use-current-state | petrpan-code/geist-org/geist-ui/components/use-current-state/__tests__/current-state.test.tsx | import React, { useEffect } from 'react'
import { mount } from 'enzyme'
import { useCurrentState } from 'components'
import { renderHook, act } from '@testing-library/react-hooks'
describe('UseCurrentState', () => {
it('should work correctly', () => {
const { result } = renderHook(() => useCurrentState(''))
... |
2,841 | 0 | petrpan-code/geist-org/geist-ui/components/use-input | petrpan-code/geist-org/geist-ui/components/use-input/__tests__/use-input.test.tsx | import React, { useEffect } from 'react'
import { mount } from 'enzyme'
import { Input, useInput } from 'components'
describe('UseInput', () => {
it('should follow change with use-input', () => {
let log = ''
const logSpy = jest.spyOn(console, 'log').mockImplementation(msg => (log = msg))
const MockInput... |
2,846 | 0 | petrpan-code/geist-org/geist-ui/components/use-keyboard | petrpan-code/geist-org/geist-ui/components/use-keyboard/__tests__/keyboard.test.tsx | import React from 'react'
import { mount } from 'enzyme'
import { useKeyboard, KeyMod, KeyCode } from 'components'
import { renderHook, act } from '@testing-library/react-hooks'
import { KeyboardResult } from '../use-keyboard'
describe('UseKeyboard', () => {
it('should work correctly', () => {
let code = null
... |
2,849 | 0 | petrpan-code/geist-org/geist-ui/components/use-media-query | petrpan-code/geist-org/geist-ui/components/use-media-query/__tests__/media-query.test.tsx | import { useMediaQuery } from 'components'
import { renderHook } from '@testing-library/react-hooks'
// @ts-ignore
import mediaQuery from 'css-mediaquery'
const mediaListMock = (width: number) => {
;(window as any).listeners = [] as Array<() => unknown>
return (query: string) => {
return {
matches: media... |
2,852 | 0 | petrpan-code/geist-org/geist-ui/components/use-modal | petrpan-code/geist-org/geist-ui/components/use-modal/__tests__/use-modal.test.tsx | import React, { useEffect } from 'react'
import { mount, ReactWrapper } from 'enzyme'
import { Modal, useModal } from 'components'
import { updateWrapper } from 'tests/utils'
export const expectModalIsOpened = (wrapper: ReactWrapper) => {
expect(wrapper.find('.position').length).not.toBe(0)
}
export const expectMod... |
2,857 | 0 | petrpan-code/geist-org/geist-ui/components/use-scale | petrpan-code/geist-org/geist-ui/components/use-scale/__tests__/scale.test.tsx | import React from 'react'
import useScale, { ScaleProps, ScaleConfig, withScale } from '../index'
import { renderHook } from '@testing-library/react-hooks'
import { mount } from 'enzyme'
const BaseComponent: React.FC<React.PropsWithChildren<unknown>> = ({ children }) => (
<div>{children}</div>
)
const ScaleComponent... |
2,860 | 0 | petrpan-code/geist-org/geist-ui/components/use-tabs | petrpan-code/geist-org/geist-ui/components/use-tabs/__tests__/use-tabs.test.tsx | import React, { useEffect } from 'react'
import { mount } from 'enzyme'
import { Tabs, useTabs } from 'components'
import { nativeEvent, updateWrapper } from 'tests/utils'
describe('UseTabs', () => {
it('should follow changes with use-tabs', async () => {
const MockTabs: React.FC<{ value?: string }> = ({ value }... |
2,868 | 0 | petrpan-code/geist-org/geist-ui/components/use-toasts | petrpan-code/geist-org/geist-ui/components/use-toasts/__tests__/index.test.tsx | import React from 'react'
import { mount, ReactWrapper } from 'enzyme'
import { useToasts, GeistProvider } from 'components'
import { nativeEvent, updateWrapper } from 'tests/utils'
import { ToastInput } from '../use-toast'
const MockToast: React.FC<unknown> = () => {
const { setToast } = useToasts()
const clickHa... |
2,869 | 0 | petrpan-code/geist-org/geist-ui/components/use-toasts/__tests__ | petrpan-code/geist-org/geist-ui/components/use-toasts/__tests__/__snapshots__/index.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`UseToast should render different actions 1`] = `
"<div class=\\"toasts\\"><div class=\\"toast toast-enter\\"><div class=\\"message\\">hello</div><div class=\\"action\\"><button type=\\"button\\" class=\\"btn\\"><div class=\\"text\\">remove</div><style>
.bt... |
2,873 | 0 | petrpan-code/geist-org/geist-ui/components/user | petrpan-code/geist-org/geist-ui/components/user/__tests__/index.test.tsx | import React from 'react'
import { mount, render } from 'enzyme'
import { User } from 'components'
describe(' User', () => {
it('should render correctly', () => {
const wrapper = mount(<User name="witt" />)
expect(() => wrapper.unmount()).not.toThrow()
})
it('should support image and text', () => {
... |
2,874 | 0 | petrpan-code/geist-org/geist-ui/components/user/__tests__ | petrpan-code/geist-org/geist-ui/components/user/__tests__/__snapshots__/index.test.tsx.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[` User should support image and text 1`] = `
LoadedCheerio {
"0": Node {
"attribs": Object {},
"children": Array [
Node {
"attribs": Object {
"class": "user",
},
"children": Array [
Node {
"attrib... |
2,896 | 0 | petrpan-code/geist-org/geist-ui/components/utils | petrpan-code/geist-org/geist-ui/components/utils/__tests__/calculations.test.tsx | import React from 'react'
import { mount } from 'enzyme'
import { getProportions, useProportions } from '../calculations'
describe('calculations', () => {
it('should return ratio and limit the length of decimals', () => {
expect(getProportions(0, 100)).toEqual(0)
expect(getProportions(50, 100)).toEqual(50)
... |
3,300 | 0 | petrpan-code/draft-js-plugins/draft-js-plugins/packages/counter/src/CharCounter | petrpan-code/draft-js-plugins/draft-js-plugins/packages/counter/src/CharCounter/__test__/index.test.tsx | import React from 'react';
import { screen, render } from '@testing-library/react';
import { PluginFunctions } from '@draft-js-plugins/editor';
import { EditorState, ContentState } from 'draft-js';
import createCounterPlugin from '../../index';
jest.mock('linaria');
describe('CounterPlugin Character Counter', () => {... |
3,302 | 0 | petrpan-code/draft-js-plugins/draft-js-plugins/packages/counter/src/CustomCounter | petrpan-code/draft-js-plugins/draft-js-plugins/packages/counter/src/CustomCounter/__test__/index.test.tsx | import React from 'react';
import { screen, render } from '@testing-library/react';
import { EditorState, ContentState } from 'draft-js';
import { PluginFunctions } from '@draft-js-plugins/editor';
import createCounterPlugin from '../../index';
jest.mock('linaria');
describe('CounterPlugin Line Counter', () => {
co... |
3,304 | 0 | petrpan-code/draft-js-plugins/draft-js-plugins/packages/counter/src/LineCounter | petrpan-code/draft-js-plugins/draft-js-plugins/packages/counter/src/LineCounter/__test__/index.test.tsx | import React from 'react';
import { screen, render } from '@testing-library/react';
import { EditorState, ContentState } from 'draft-js';
import { PluginFunctions } from '@draft-js-plugins/editor';
import createCounterPlugin from '../../index';
jest.mock('linaria');
describe('CounterPlugin Line Counter', () => {
co... |
3,306 | 0 | petrpan-code/draft-js-plugins/draft-js-plugins/packages/counter/src/WordCounter | petrpan-code/draft-js-plugins/draft-js-plugins/packages/counter/src/WordCounter/__test__/index.test.tsx | import React from 'react';
import { screen, render } from '@testing-library/react';
import { EditorState, ContentState } from 'draft-js';
import { PluginFunctions } from '@draft-js-plugins/editor';
import createCounterPlugin from '../../index';
jest.mock('linaria');
describe('CounterPlugin Word Counter', () => {
co... |
3,595 | 0 | petrpan-code/draft-js-plugins/draft-js-plugins/packages/editor/src/Editor | petrpan-code/draft-js-plugins/draft-js-plugins/packages/editor/src/Editor/__test__/MultiDecorator.test.ts | import Draft from 'draft-js';
import MultiDecorator from '../MultiDecorator';
describe('MultiDecorator', () => {
const contentBlock = new Draft.ContentBlock({
text: 'AAA BBB CCC ABC',
});
const firstDecorator = new Draft.CompositeDecorator([
{
strategy(block, callback) {
callback(0, 3);
... |
3,596 | 0 | petrpan-code/draft-js-plugins/draft-js-plugins/packages/editor/src/Editor | petrpan-code/draft-js-plugins/draft-js-plugins/packages/editor/src/Editor/__test__/index.test.ts | //test are currently disabled as mocha is removed and the component will be rewritten with react hooks
test.skip('', () => {
//nothing to do here for the moment
}); /*
/*
import React, { Component } from 'react';
import { mount, shallow } from 'enzyme';
import chai, { expect } from 'chai';
import sinonChai from 'si... |
3,611 | 0 | petrpan-code/draft-js-plugins/draft-js-plugins/packages/emoji/src | petrpan-code/draft-js-plugins/draft-js-plugins/packages/emoji/src/__test__/EmojiSelect.test.tsx | import { EditorState } from 'draft-js';
import React from 'react';
import { fireEvent, render, RenderResult } from '@testing-library/react';
import { EmojiPluginStore } from '../index';
import EmojiSelect from '../components/EmojiSelect/index';
import NativeEmojiImage from '../components/Emoji/NativeEmojiImage';
class... |
3,612 | 0 | petrpan-code/draft-js-plugins/draft-js-plugins/packages/emoji/src | petrpan-code/draft-js-plugins/draft-js-plugins/packages/emoji/src/__test__/emojiSuggestionsStrategy.test.ts | import {
ContentBlock,
convertFromRaw,
genKey,
RawDraftEntity,
RawDraftEntityRange,
} from 'draft-js';
import emojiSuggestionsStrategy from '../emojiSuggestionsStrategy';
const getBlock = (
text: string,
entityRanges: RawDraftEntityRange[] = [],
entityMap: { [key: string]: RawDraftEntity } = {}
): Cont... |
3,640 | 0 | petrpan-code/draft-js-plugins/draft-js-plugins/packages/emoji/src/utils | petrpan-code/draft-js-plugins/draft-js-plugins/packages/emoji/src/utils/__test__/getWordAt.test.ts | import getWordAt from '../getWordAt';
describe('getWordAt', () => {
it('finds a word in between sentence', () => {
const expected = {
word: 'is',
begin: 5,
end: 7,
};
expect(getWordAt('this is a test', 5)).toEqual(expected);
});
it('finds the first word', () => {
const expected... |
3,650 | 0 | petrpan-code/draft-js-plugins/draft-js-plugins/packages/focus/src | petrpan-code/draft-js-plugins/draft-js-plugins/packages/focus/src/__test__/index.test.ts | import { PluginFunctions } from '@draft-js-plugins/editor';
import {
ContentBlock,
ContentState,
EditorState,
SelectionState,
} from 'draft-js';
import createFocusPlugin from '../index';
const mockCreateBlockKeyStore = jest.requireActual(
'../utils/createBlockKeyStore'
);
jest.mock('linaria');
let mockBloc... |
3,669 | 0 | petrpan-code/draft-js-plugins/draft-js-plugins/packages/hashtag/src | petrpan-code/draft-js-plugins/draft-js-plugins/packages/hashtag/src/__test__/Hashtag.test.tsx | import React from 'react';
import { render } from '@testing-library/react';
import Hashtag from '../Hashtag';
describe('Hashtag', () => {
it('applies the className based on the theme property `hashtag`', () => {
const theme = { hashtag: 'custom-class-name' };
const { container } = render(<Hashtag theme={them... |
3,672 | 0 | petrpan-code/draft-js-plugins/draft-js-plugins/packages/hashtag/src/utils | petrpan-code/draft-js-plugins/draft-js-plugins/packages/hashtag/src/utils/__test__/extractHashtags.test.ts | import { extractHashtagsWithIndices } from '../extractHashtags';
test.each([
['test empty string', '', []],
[
'text without link',
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus tempor, elit eu auctor dapibus, nisi massa ultricies turpis, vitae egestas',
[],
],
[
'text with l... |
3,692 | 0 | petrpan-code/draft-js-plugins/draft-js-plugins/packages/inline-toolbar/src/components/Toolbar | petrpan-code/draft-js-plugins/draft-js-plugins/packages/inline-toolbar/src/components/Toolbar/__test__/Toolbar.test.tsx | import { createStore } from '@draft-js-plugins/utils';
import { EditorState } from 'draft-js';
import React, { ReactElement, useEffect } from 'react';
import { render } from '@testing-library/react';
import { StoreItemMap } from '../../../';
import Toolbar, { ToolbarChildrenProps } from '../index';
jest.useFakeTimers(... |
3,703 | 0 | petrpan-code/draft-js-plugins/draft-js-plugins/packages/linkify/src/Link | petrpan-code/draft-js-plugins/draft-js-plugins/packages/linkify/src/Link/__test__/Link.test.tsx | /* eslint-disable jsx-a11y/anchor-has-content,react/no-children-prop */
import React from 'react';
import { render } from '@testing-library/react';
import LinkifyIt from 'linkify-it';
import Link from '../Link';
describe('Link', () => {
it('applies the className based on the theme property `link` and property', () ... |
3,705 | 0 | petrpan-code/draft-js-plugins/draft-js-plugins/packages/linkify/src/utils | petrpan-code/draft-js-plugins/draft-js-plugins/packages/linkify/src/utils/__test__/extractLinks.test.ts | import { extractLinks } from '../extractLinks';
test.each([
['test empty string', '', null],
[
'text without link',
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus tempor, elit eu auctor dapibus, nisi massa ultricies turpis, vitae egestas',
null,
],
[
'text with link',
'Lo... |
3,724 | 0 | petrpan-code/draft-js-plugins/draft-js-plugins/packages/mention/src/MentionSuggestions | petrpan-code/draft-js-plugins/draft-js-plugins/packages/mention/src/MentionSuggestions/__test__/MentionSuggestions.test.tsx | import { render } from '@testing-library/react';
import React, { ReactElement, ReactNode } from 'react';
import {
MentionSuggestions,
MentionSuggestionsProps,
} from '../MentionSuggestions';
window.HTMLElement.prototype.scrollIntoView = jest.fn();
const mentions = [
{
name: 'Matthew Russell',
link: 'htt... |
3,725 | 0 | petrpan-code/draft-js-plugins/draft-js-plugins/packages/mention/src | petrpan-code/draft-js-plugins/draft-js-plugins/packages/mention/src/__test__/Mention.test.tsx | import { render, screen } from '@testing-library/react';
import { ContentState } from 'draft-js';
import React from 'react';
import Mention from '../Mention';
describe('Mention', () => {
it('renders an Anchor tag in case a link is provided', () => {
const mention = {
link: 'https://www.example.com/john',
... |
3,726 | 0 | petrpan-code/draft-js-plugins/draft-js-plugins/packages/mention/src | petrpan-code/draft-js-plugins/draft-js-plugins/packages/mention/src/__test__/mentionSuggestionsStrategy.test.ts | import {
ContentBlock,
convertFromRaw,
genKey,
RawDraftEntity,
RawDraftEntityRange,
} from 'draft-js';
import mentionSuggestionsStrategy from '../mentionSuggestionsStrategy';
import defaultRegExp from '../defaultRegExp';
const getBlock = (
text: string,
entityRanges: RawDraftEntityRange[] = [],
entityM... |
3,736 | 0 | petrpan-code/draft-js-plugins/draft-js-plugins/packages/mention/src/utils | petrpan-code/draft-js-plugins/draft-js-plugins/packages/mention/src/utils/__test__/getSearchTextAt.test.ts | import getSearchTextAt from '../getSearchTextAt';
describe('getSearchTextAt', () => {
test.each([
[
'finds the matching string following trigger',
'hi @The Walking Dead',
20,
['@'],
{
matchingString: 'The Walking Dead',
begin: 3,
end: 20,
},
],
... |
3,737 | 0 | petrpan-code/draft-js-plugins/draft-js-plugins/packages/mention/src/utils | petrpan-code/draft-js-plugins/draft-js-plugins/packages/mention/src/utils/__test__/getTriggerForMention.test.ts | import {
EditorState,
convertFromRaw,
SelectionState,
CompositeDecorator,
} from 'draft-js';
import { Map } from 'immutable';
import defaultRegExp from '../../defaultRegExp';
import MentionSuggestionsPortal from '../../MentionSuggestionsPortal';
import mentionSuggestionsStrategy from '../../mentionSuggestionsSt... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.