Skip to content
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

Draft
wants to merge 2 commits into
base: proto
Choose a base branch
from
Draft

Conversation

Denisfront
Copy link
Collaborator

No description provided.

@Denisfront Denisfront changed the base branch from main to proto March 4, 2022 06:29
Comment on lines +141 to +157
// 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;')
Copy link

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",
Copy link

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: [],
Copy link

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'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Использую свою утилку

Comment on lines +30 to +35
// 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()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Здесь иначе не получилось замокать? Или может тс как то для тестов настроить?

Comment on lines +97 to +103
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()
Copy link

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')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут лучше проверять не аттрибует, а пропу

Comment on lines +125 to +127
await flushPromises()
createComponent()
await flushPromises()
Copy link

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')
Copy link

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)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

По логике disabled должен быть false, как мне кажется. Возможно тут undefined потому что аттрибут со значением false удаляется.. Поэтому я бы пропу проверяла все таки)

@Denisfront Denisfront marked this pull request as draft March 22, 2022 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants