Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

docs: Add example for Apollo GraphQL + composition API #192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
afontcu merged 11 commits into testing-library:next from agualis:next
Dec 17, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs: Add example for external UI library
  • Loading branch information
afontcu committed Dec 10, 2020
commit f4ac8d72d9250d45c030695692edc45afe6b100b
1 change: 1 addition & 0 deletions package.json
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"apollo-client": "^2.6.10",
"axios": "^0.20.0",
"dtslint": "^4.0.6",
"element-plus": "^1.0.1-beta.7",
"eslint-plugin-vue": "^7.1.0",
"graphql": "^15.4.0",
"graphql-tag": "^2.11.0",
Expand Down
37 changes: 37 additions & 0 deletions src/__tests__/element-plus.js
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import ElementPlus from 'element-plus'
import {defineComponent} from 'vue'
import userEvent from '@testing-library/user-event'
import '@testing-library/jest-dom'
import {render, screen, waitFor} from '..'

const Component = defineComponent({
template: `
<el-popover trigger="hover" content="this is content">
<template #reference>
<el-button>Hover to activate</el-button>
</template>
</el-popover>
`,
})

test('Stubs out a component', async () => {
render(Component, {
global: {
plugins: [ElementPlus],
},
})

const button = screen.getByText('Hover to activate')
const getContent = () => screen.getByText('this is content')

expect(getContent()).toBeInTheDocument()
expect(getContent()).not.toBeVisible()

userEvent.hover(button)

await waitFor(() => expect(getContent()).toBeVisible())

userEvent.unhover(button)

await waitFor(() => expect(getContent()).not.toBeVisible())
})

AltStyle によって変換されたページ (->オリジナル) /