-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(vue3): support for ServiceViewModel in c-admin-method(s?)
- Loading branch information
Showing
7 changed files
with
93 additions
and
19 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
39 changes: 39 additions & 0 deletions
39
src/coalesce-vue-vuetify3/src/components/admin/c-admin-method.spec.tsx
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,39 @@ | ||
import { CAdminMethod } from ".."; | ||
import { | ||
PersonViewModel, | ||
PersonListViewModel, | ||
WeatherServiceViewModel, | ||
} from "@test-targets/viewmodels.g"; | ||
|
||
describe("CAdminMethod", () => { | ||
test("types", () => { | ||
const vm = new PersonViewModel(); | ||
const listVm = new PersonListViewModel(); | ||
const serviceVm = new WeatherServiceViewModel(); | ||
|
||
const rename = vm.$metadata.methods.rename; | ||
const getUser = listVm.$metadata.methods.getUser; | ||
const getWeather = serviceVm.$metadata.methods.getWeather; | ||
|
||
() => <CAdminMethod model={vm} for="rename" />; | ||
() => <CAdminMethod model={vm} for={rename} />; | ||
//@ts-expect-error method doesn't exist | ||
() => <CAdminMethod model={vm} for="invalid" />; | ||
//@ts-expect-error method from wrong type | ||
() => <CAdminMethod model={vm} for={getWeather} />; | ||
|
||
() => <CAdminMethod model={listVm} for="getUser" />; | ||
() => <CAdminMethod model={listVm} for={getUser} />; | ||
//@ts-expect-error method doesn't exist | ||
() => <CAdminMethod model={listVm} for="invalid" />; | ||
//@ts-expect-error method from wrong type | ||
() => <CAdminMethod model={listVm} for={getWeather} />; | ||
|
||
() => <CAdminMethod model={serviceVm} for="getWeather" />; | ||
() => <CAdminMethod model={serviceVm} for={getWeather} />; | ||
//@ts-expect-error method doesn't exist | ||
() => <CAdminMethod model={serviceVm} for="invalid" />; | ||
//@ts-expect-error method from wrong type | ||
() => <CAdminMethod model={serviceVm} for={rename} />; | ||
}); | ||
}); |
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
23 changes: 23 additions & 0 deletions
23
src/coalesce-vue-vuetify3/src/components/admin/c-admin-methods.spec.tsx
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,23 @@ | ||
import { CAdminMethods } from ".."; | ||
import { | ||
PersonViewModel, | ||
PersonListViewModel, | ||
WeatherServiceViewModel, | ||
} from "@test-targets/viewmodels.g"; | ||
|
||
describe("CAdminMethods", () => { | ||
test("types", () => { | ||
const vm = new PersonViewModel(); | ||
const listVm = new PersonListViewModel(); | ||
const serviceVm = new WeatherServiceViewModel(); | ||
|
||
const rename = vm.$metadata.methods.rename; | ||
|
||
() => <CAdminMethods model={vm} />; | ||
() => <CAdminMethods model={listVm} />; | ||
() => <CAdminMethods model={serviceVm} />; | ||
|
||
// @ts-expect-error not a model | ||
() => <CAdminMethods model={rename} />; | ||
}); | ||
}); |
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