-
-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(BToast): animation not working fixes #1645 feat(BToastOrchestrator): add move transitions feat(BToastOrchestrator): appendToast prop working and show method incorporates appendToast feat(BToast)!: remove animation prop... Had no use refactor: shared CommonInputProps and shared FormDebounceOptions
- Loading branch information
1 parent
0908731
commit ead580f
Showing
19 changed files
with
597 additions
and
910 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
2 changes: 2 additions & 0 deletions
2
packages/bootstrap-vue-next/src/components/BModal/BModalOrchestrator.vue
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
21 changes: 21 additions & 0 deletions
21
packages/bootstrap-vue-next/src/components/BToast/toast-orchestrator.spec.ts
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import {enableAutoUnmount, mount} from '@vue/test-utils' | ||
import {afterEach, describe, expect, it} from 'vitest' | ||
import BToastOrchestrator from './BToastOrchestrator.vue' | ||
|
||
describe('toast-orchestator', () => { | ||
enableAutoUnmount(afterEach) | ||
|
||
it('has expected structure', async () => { | ||
const wrapper = mount(BToastOrchestrator, { | ||
global: {stubs: {teleport: true}}, | ||
}) | ||
|
||
expect(wrapper.vm).toBeDefined() | ||
|
||
const $div = wrapper.find('div') | ||
expect($div.attributes('id')).toBe('__BVID__toaster-container') | ||
expect($div.attributes('aria-live')).toBeUndefined() | ||
expect($div.attributes('aria-atomic')).toBeUndefined() | ||
expect($div.attributes('role')).toBeUndefined() | ||
}) | ||
}) |
61 changes: 61 additions & 0 deletions
61
packages/bootstrap-vue-next/src/components/BToast/toast.spec.ts
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 |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import {enableAutoUnmount, mount} from '@vue/test-utils' | ||
import {afterEach, describe, expect, it} from 'vitest' | ||
import {nextTick} from 'vue' | ||
import BToast from './BToast.vue' | ||
|
||
describe('toast', () => { | ||
enableAutoUnmount(afterEach) | ||
|
||
it('has expected structure', async () => { | ||
const wrapper = mount(BToast, { | ||
attachTo: document.body, | ||
props: { | ||
modelValue: true, | ||
title: 'title', | ||
}, | ||
slots: { | ||
default: 'content', | ||
}, | ||
}) | ||
|
||
expect(wrapper.vm).toBeDefined() | ||
await nextTick() | ||
|
||
expect(wrapper.element.tagName).toBe('TRANSITION-STUB') | ||
|
||
expect(wrapper.find('.toast').exists()).toBe(true) | ||
|
||
const $toast = wrapper.find('.toast') | ||
expect($toast.element.tagName).toBe('DIV') | ||
expect($toast.classes()).toContain('toast') | ||
expect($toast.classes()).toContain('show') | ||
expect($toast.attributes('role')).toEqual('alert') | ||
expect($toast.attributes('aria-live')).toEqual('assertive') | ||
expect($toast.attributes('aria-atomic')).toEqual('true') | ||
expect($toast.attributes('tabindex')).toEqual('0') | ||
|
||
expect($toast.find('.toast-header').exists()).toBe(true) | ||
const $header = $toast.find('.toast-header') | ||
expect($header.element.tagName).toBe('DIV') | ||
expect($header.classes().length).toBe(1) | ||
expect($header.find('strong').exists()).toBe(true) | ||
expect($header.find('strong').text()).toEqual('title') | ||
expect($header.find('strong').classes()).toContain('me-auto') | ||
expect($header.find('button').exists()).toBe(true) | ||
expect($header.find('button').classes()).toContain('btn-close') | ||
|
||
expect($toast.find('.toast-body').exists()).toBe(true) | ||
const $body = $toast.find('.toast-body') | ||
expect($body.element.tagName).toBe('DIV') | ||
expect($body.classes().length).toBe(1) | ||
expect($body.text()).toEqual('content') | ||
|
||
wrapper.unmount() | ||
}) | ||
|
||
it.skip('has correct header tag when "header-tag" prop is set', () => {}) | ||
it.skip('alert with link closes on click works', () => {}) | ||
it.skip('auto-hide works', () => {}) | ||
it.skip('hover pause works', () => {}) | ||
it.skip('hover pause has no effect when no-hover-pause is set', () => {}) | ||
}) |
28 changes: 2 additions & 26 deletions
28
packages/bootstrap-vue-next/src/composables/useFormInput.ts
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
Oops, something went wrong.