@forsakringskassan/vue-lib-template 1.7.0 → 1.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -99,7 +99,7 @@
99
99
  "@forsakringskassan/cypress-visual-regression": "5.2.0",
100
100
  "@forsakringskassan/docs-generator": "3.18.0",
101
101
  "@forsakringskassan/docs-live-example": "3.0.3",
102
- "@forsakringskassan/eslint-config": "15.11.12",
102
+ "@forsakringskassan/eslint-config": "15.11.13",
103
103
  "@forsakringskassan/eslint-config-cli": "15.11.11",
104
104
  "@forsakringskassan/eslint-config-cypress": "15.11.10",
105
105
  "@forsakringskassan/eslint-config-jest": "15.11.1",
@@ -111,7 +111,7 @@
111
111
  "@forsakringskassan/stylelint-config": "3.5.1",
112
112
  "@forsakringskassan/vite-lib-config": "5.13.0",
113
113
  "@forsakringskassan/vitest-config-jsdom": "5.0.1",
114
- "@forsakringskassan/vue-lib-template": "1.7.0",
114
+ "@forsakringskassan/vue-lib-template": "1.7.2",
115
115
  "@html-validate/release-scripts": "7.6.12",
116
116
  "@types/node": "24.19.1",
117
117
  "@typescript/native": "npm:typescript@7.0.2",
@@ -1,5 +1,4 @@
1
1
  import { beforeEach, describe, expect, it, vi } from "vitest";
2
- import { catGetById } from "./cat-api";
3
2
 
4
3
  describe("catGetById", () => {
5
4
  vi.stubEnv("VITE_CAT_API_URL", "/api/cat");
@@ -10,6 +9,7 @@ describe("catGetById", () => {
10
9
 
11
10
  it("should return a cat when the response is ok", async () => {
12
11
  expect.assertions(2);
12
+ const { catGetById } = await import("./cat-api");
13
13
  const mockCat = {
14
14
  id: "whiskers-001",
15
15
  name: "Whiskers McFluffington",
@@ -32,6 +32,7 @@ describe("catGetById", () => {
32
32
 
33
33
  it("should throw an error with API message when response is not ok", async () => {
34
34
  expect.assertions(1);
35
+ const { catGetById } = await import("./cat-api");
35
36
  const errorResponse = { error: "Cat with ID 'unknown' not found" };
36
37
 
37
38
  vi.mocked(fetch).mockResolvedValue({
@@ -46,6 +47,7 @@ describe("catGetById", () => {
46
47
 
47
48
  it("should throw a generic error when response is not ok and no error message is provided", async () => {
48
49
  expect.assertions(1);
50
+ const { catGetById } = await import("./cat-api");
49
51
  vi.mocked(fetch).mockResolvedValue({
50
52
  ok: false,
51
53
  json: () => Promise.resolve({}),
@@ -58,6 +60,7 @@ describe("catGetById", () => {
58
60
 
59
61
  it("should throw an error when fetch fails", async () => {
60
62
  expect.assertions(1);
63
+ const { catGetById } = await import("./cat-api");
61
64
  vi.mocked(fetch).mockRejectedValue(new Error("Network failure"));
62
65
 
63
66
  await expect(catGetById("whiskers-001")).rejects.toThrow(
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { ref } from "vue";
3
- import FcCatInfo from "../cat-info.vue";
3
+ import { FcCatInfo } from "@forsakringskassan/vue-lib-template";
4
4
 
5
5
  const selectedCatId = ref("whiskers-001");
6
6
  const isEditable = ref(false);
@@ -2,8 +2,7 @@
2
2
  import { defineComponent } from "vue";
3
3
  import { FCheckboxField, FSelectField } from "@fkui/vue";
4
4
  import { LiveExample } from "@forsakringskassan/docs-live-example";
5
- import { getCatIds } from "../cat-data.js";
6
- import FcCatInfo from "../cat-info.vue";
5
+ import { FcCatInfo } from "@forsakringskassan/vue-lib-template";
7
6
 
8
7
  export default defineComponent({
9
8
  name: "FcCatInfoLiveExample",
@@ -12,7 +11,6 @@ export default defineComponent({
12
11
  return {
13
12
  selectedCatId: "whiskers-001",
14
13
  isEditable: false,
15
- catIds: getCatIds(),
16
14
  };
17
15
  },
18
16
  computed: {
package/hooks/install.mjs CHANGED
@@ -38,6 +38,16 @@ export async function install(context ) {
38
38
  await replaceInFile("tsconfig.lib.json", placeholder, quotedName);
39
39
  await replaceInFile("tsconfig.cypress.json", placeholder, quotedName);
40
40
  await replaceInFile("tsconfig.selectors.json", placeholder, quotedName);
41
+ await replaceInFile(
42
+ "src/components/guide/cat-info/examples/cat-info-example.vue",
43
+ placeholder,
44
+ quotedName,
45
+ );
46
+ await replaceInFile(
47
+ "src/components/guide/cat-info/examples/cat-info-live-example.vue",
48
+ placeholder,
49
+ quotedName,
50
+ );
41
51
 
42
52
  /* enable deployment of documentation if a documentation url is provided */
43
53
  await enableDeployDocs(context);
package/index.js CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  const options = {
9
9
  ...packageJson.cloneman,
10
- fileHash: "dadb82e83a4be93c7da8f675e4f5240fe7e0d537728795cae490ab87c0cd928c",
10
+ fileHash: "9936efbee4f4c6a825ed9be0159331c8b2cdb765b2c0776a1ae06a226f9e6bc6",
11
11
  apiVersion: 0,
12
12
  clonemanVersion: "1.27.0",
13
13
  filesDir: path.join(import.meta.dirname, "files"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forsakringskassan/vue-lib-template",
3
- "version": "1.7.0",
3
+ "version": "1.7.2",
4
4
  "description": "Vue library template based on Cloneman",
5
5
  "keywords": [
6
6
  "template",