-
Notifications
You must be signed in to change notification settings - Fork 7
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
Feature/test create profile #71
base: proto
Are you sure you want to change the base?
Conversation
// eslint-disable-next-line vue/max-len | ||
// it('After selecting a color theme and clicking on the Next button, the transition to the next step takes place', async () => { | ||
// await flushPromises() | ||
// createComponent() | ||
|
||
// await flushPromises() | ||
|
||
// const createProfileSelectColorScheme = findCreateProfileSelectColorScheme() | ||
|
||
// await flushPromises() | ||
// const nextButton = findButtonByText('Next') | ||
// const selectedColorScheme = createProfileSelectColorScheme.props().options[0] | ||
|
||
// createProfileSelectColorScheme.vm.$emit('update:selected-color-scheme', selectedColorScheme) | ||
// createProfileSelectColorScheme.vm.$emit('select-color-scheme') | ||
// const findSwapStepperContentItems = () => wrapper.findAll('[data-test-id=swap-stepper-content]') | ||
// expect(findSwapStepperContentItems().wrappers[STEPS[2]].attributes().style).toBe('display: none;') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
???
@@ -22,6 +22,7 @@ | |||
"core-js": "^3.6.5", | |||
"ed25519-hd-key": "^1.2.0", | |||
"ethereumjs-wallet": "^1.0.1", | |||
"flush-promises": "^1.0.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В утилках своя реализация
@@ -179,7 +179,7 @@ export default Vue.extend({ | |||
|
|||
data(): Data { | |||
return { | |||
profilesParameters: profileService.getProfilesParameters(), | |||
profilesParameters: [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Тут ничего не поломалось?
import mnemonicPhraseTable from '@/components/Profile/MnemonicPhraseTable.vue' | ||
import { shallowMount } from '@vue/test-utils' | ||
import * as commonUtils from '@/utils/common' | ||
import flushPromises from 'flush-promises' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Использую свою утилку
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
|
||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
commonUtils.setCSSCustomProperty = jest.fn() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Здесь иначе не получилось замокать? Или может тс как то для тестов настроить?
const createProfileSelectColorScheme = findCreateProfileSelectColorScheme() | ||
await flushPromises() | ||
console.log(createProfileSelectColorScheme.props().options) | ||
const oldOptions = createProfileSelectColorScheme.props().options | ||
await flushPromises() | ||
createProfileSelectColorScheme.vm.$emit('refresh-color-schemes') | ||
await flushPromises() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Что тут происходит?
|
||
const backButton = findButtonByText('Next') | ||
|
||
expect(backButton.attributes('disabled')).toBe('true') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Тут лучше проверять не аттрибует, а пропу
await flushPromises() | ||
createComponent() | ||
await flushPromises() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Почему так?
const createProfileSelectColorScheme = findCreateProfileSelectColorScheme() | ||
|
||
const nextButton = findButtonByText('Next') | ||
expect(nextButton.attributes().disabled).toBe('true') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expect(nextButton.props().disabled).toBe(true)
await createProfileSelectColorScheme.vm.$emit('update:selected-color-scheme', selectedColorScheme) | ||
createProfileSelectColorScheme.vm.$emit('select-color-scheme') | ||
await wrapper.vm.$nextTick() | ||
expect(nextButton.attributes().disabled).toBe(undefined) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
По логике disabled должен быть false, как мне кажется. Возможно тут undefined потому что аттрибут со значением false удаляется.. Поэтому я бы пропу проверяла все таки)
No description provided.