-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
2aadcaf
commit cea6731
Showing
40 changed files
with
102 additions
and
103 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,17 @@ | ||
import {expect, it} from 'vitest'; | ||
import {type ComponentMountingOptions, mount} from '@vue/test-utils'; | ||
import {mount} from '@vue/test-utils'; | ||
import {type PartialComponentTest} from '../types'; | ||
|
||
export const runHasPropTest: PartialComponentTest = (component, options, prop, value = 'value') => { | ||
export const runHasPropTest = ((component, options, prop, value = 'value') => { | ||
it(`has prop ${prop}`, () => { | ||
const wrapper = mount( | ||
component as any, | ||
{ | ||
...options, | ||
props: { | ||
...options?.props, | ||
[prop as string]: value, | ||
}, | ||
} as ComponentMountingOptions<any>, | ||
); | ||
const wrapper = mount(component, { | ||
...options, | ||
props: { | ||
...(options?.props as any), | ||
[prop]: value, | ||
}, | ||
}); | ||
|
||
expect(wrapper.props(prop as string)).toBe('value'); | ||
expect(wrapper.props(prop as any)).toBe('value'); | ||
}); | ||
}; | ||
}) satisfies PartialComponentTest<[string] | [string, unknown]>; |
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,6 +1,6 @@ | ||
import {type AdminComponentTest} from '../tests'; | ||
import {runCommonComponentTests} from '../common'; | ||
|
||
export const runBadgeTest: AdminComponentTest = (component) => { | ||
export const runBadgeTest = ((component) => { | ||
runCommonComponentTests(component); | ||
}; | ||
}) satisfies AdminComponentTest; |
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
4 changes: 2 additions & 2 deletions
4
apps/admin-component-tests/src/components/runCodeEditorTest.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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import {type AdminComponentTest} from '../tests'; | ||
import {runCommonComponentTests} from '../common'; | ||
|
||
export const runCodeEditorTest: AdminComponentTest = (component) => { | ||
export const runCodeEditorTest = ((component) => { | ||
runCommonComponentTests(component); | ||
}; | ||
}) satisfies AdminComponentTest; |
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,9 +1,9 @@ | ||
import {type AdminComponentTest} from '../tests'; | ||
import {runCommonComponentTests, runHasPropTest, runHasSlotTest} from '../common'; | ||
|
||
export const runColTest: AdminComponentTest = (component) => { | ||
export const runColTest = ((component) => { | ||
runCommonComponentTests(component); | ||
|
||
runHasSlotTest(component, {}); | ||
runHasPropTest(component, {}, 'span', 3); | ||
}; | ||
}) satisfies AdminComponentTest; |
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,6 +1,6 @@ | ||
import {type AdminComponentTest} from '../tests'; | ||
import {runCommonComponentTests} from '../common'; | ||
|
||
export const runLoaderTest: AdminComponentTest = (component) => { | ||
export const runLoaderTest = ((component) => { | ||
runCommonComponentTests(component); | ||
}; | ||
}) satisfies AdminComponentTest; |
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
4 changes: 2 additions & 2 deletions
4
apps/admin-component-tests/src/components/runMultiSelectInputTest.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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import {type AdminComponentTest} from '../tests'; | ||
import {runCommonComponentTests} from '../common'; | ||
|
||
export const runMultiSelectInputTest: AdminComponentTest = (component) => { | ||
export const runMultiSelectInputTest = ((component) => { | ||
runCommonComponentTests(component); | ||
}; | ||
}) satisfies AdminComponentTest; |
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
4 changes: 2 additions & 2 deletions
4
apps/admin-component-tests/src/components/runPlainWrapperTest.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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import {type AdminComponentTest} from '../tests'; | ||
import {runCommonComponentTests, runHasSlotTest} from '../common'; | ||
|
||
export const runPlainWrapperTest: AdminComponentTest = (component) => { | ||
export const runPlainWrapperTest = ((component) => { | ||
runCommonComponentTests(component); | ||
|
||
runHasSlotTest(component); | ||
|
||
// TODO write more tests | ||
}; | ||
}) satisfies AdminComponentTest; |
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
Oops, something went wrong.