-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge pull request #43 from mnenie/dev
fix: keep alive and composable, test: add some tests
- Loading branch information
Showing
8 changed files
with
47 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { describe, it, expect } from 'vitest'; | ||
import { mount } from '@vue/test-utils'; | ||
import '@/shared/lib/vitest-utils/cookiesI18n-mock'; | ||
import KanbanWrapper from '../KanbanWrapper.vue'; | ||
import { AddColumn, DragColumns } from '@/features/kanban'; | ||
import i18n from '@/shared/lib/i18n'; | ||
|
||
describe('tests for KanbanWrapper.vue', () => { | ||
const wrapper = mount(KanbanWrapper, { | ||
global: { plugins: [i18n] }, | ||
props: { | ||
columns: [] | ||
} | ||
}); | ||
|
||
it('should be render correctly', () => { | ||
expect(wrapper.html()).toMatchSnapshot(); | ||
}); | ||
|
||
it('should render subcomponents', () => { | ||
expect(wrapper.findComponent(DragColumns).exists()).toBe(true); | ||
expect(wrapper.findComponent(AddColumn).exists()).toBe(true); | ||
}); | ||
}); |
15 changes: 15 additions & 0 deletions
15
src/widgets/kanban/ui/__tests__/__snapshots__/KanbanWarpper.spec.ts.snap
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,15 @@ | ||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html | ||
|
||
exports[`tests for KanbanWrapper.vue > should be render correctly 1`] = ` | ||
"<div class="kanban_wrapper"> | ||
<div> | ||
<div class="columns" tag="ul" name="flip-list" type="transition"></div> | ||
</div> | ||
<div class="text-sm block"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="var(--zinc-500)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-plus-icon"> | ||
<path d="M5 12h14"></path> | ||
<path d="M12 5v14"></path> | ||
</svg> Add new column</div> | ||
<!--teleport start--> | ||
<!--teleport end--> | ||
</div>" | ||
`; |
File renamed without changes.
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