-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
62 changed files
with
2,723 additions
and
2,211 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,55 @@ | ||
import AddressCardButton from '@/components/AddressCardButton.vue' | ||
import { mount } from '@vue/test-utils' | ||
import { describe, expect, test } from 'vitest' | ||
import i18n from '@/plugins/i18n' | ||
import { createMocks } from '../../utils' | ||
import { ElTooltip } from 'element-plus' | ||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome' | ||
|
||
describe('AddressCardButton.vue', () => { | ||
describe('should render correctly', () => { | ||
test('should render the card', () => { | ||
const wrapper = mount(AddressCardButton, { | ||
global: { | ||
plugins: [i18n], | ||
}, | ||
}) | ||
const wrapper = mount( | ||
AddressCardButton, | ||
createMocks({ | ||
storeModules: { | ||
uiInteractions: { | ||
state: { | ||
receiveTransactionClicked: true, | ||
}, | ||
}, | ||
}, | ||
stubs: { | ||
'el-tooltip': ElTooltip, | ||
'font-awesome-icon': FontAwesomeIcon, | ||
}, | ||
}), | ||
) | ||
|
||
expect(wrapper.find('.card').exists()).toBe(true) | ||
expect(wrapper.find('[data-test="address-card-button"]').exists()).toBe( | ||
true, | ||
) | ||
}) | ||
|
||
test('should render the icon', () => { | ||
const wrapper = mount(AddressCardButton, { | ||
global: { | ||
plugins: [i18n], | ||
}, | ||
}) | ||
|
||
expect(wrapper.find('.icon').classes().includes('fa-plus')).toBe(true) | ||
test('should emit click event on click button', async () => { | ||
const wrapper = mount( | ||
AddressCardButton, | ||
createMocks({ | ||
storeModules: { | ||
uiInteractions: { | ||
state: { | ||
receiveTransactionClicked: true, | ||
}, | ||
}, | ||
}, | ||
stubs: { | ||
'el-tooltip': ElTooltip, | ||
'font-awesome-icon': FontAwesomeIcon, | ||
}, | ||
}), | ||
) | ||
const btn = wrapper.find('[data-test="address-card-button"]') | ||
await btn.trigger('click') | ||
expect(wrapper.emitted().click).toBeTruthy | ||
}) | ||
}) | ||
}) |
Oops, something went wrong.