From 16816a916c8e679c72ef414ad3d81406ccafd1fc Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sat, 15 Jul 2023 18:55:03 +0200 Subject: [PATCH] Fix tests --- package.json | 2 +- scripts/generateCache.ts | 40 +++++++++---------- test/Logic/Actors/Actors.spec.ts | 10 ++--- ...teMultiPolygonWithPointReuseAction.spec.ts | 15 +++++-- test/Logic/ExtraFunctions.spec.ts | 4 +- test/Logic/GeoOperations.spec.ts | 2 +- .../ImageProviders/ImageProviders.spec.ts | 6 +-- .../OSM/Actions/RelationSplitHandler.spec.ts | 14 +++---- .../OSM/Actions/ReplaceGeometryAction.spec.ts | 16 ++++---- test/Logic/OSM/Actions/SplitAction.spec.ts | 10 ++--- test/Logic/OSM/Changes.spec.ts | 8 ++-- test/Logic/OSM/ChangesetHandler.spec.ts | 10 ++--- test/Logic/OSM/OsmObject.spec.ts | 6 +-- test/Logic/Tags/LazyMatching.spec.ts | 4 +- test/Logic/Tags/OptimizeTags.spec.ts | 12 +++--- test/Logic/Tags/TagUtils.spec.ts | 2 +- test/Logic/Web/Wikidata.spec.ts | 4 +- .../Conversion/CreateNoteImportLayer.spec.ts | 12 +++--- .../Conversion/FixLegacyTheme.spec.ts | 4 +- .../Conversion/PrepareLayer.spec.ts | 12 +++--- .../Conversion/PrepareTheme.spec.ts | 24 +++++------ test/Models/ThemeConfig/SourceConfig.spec.ts | 4 +- .../ThemeConfig/TagRenderingConfig.spec.ts | 4 +- test/Models/Units.spec.ts | 4 +- test/UI/SpecialVisualisations.spec.ts | 2 +- test/Utils.MinifyJson.spec.ts | 2 +- test/scripts/GenerateCache.spec.ts | 2 +- test/testhooks.ts | 6 +-- 28 files changed, 124 insertions(+), 117 deletions(-) diff --git a/package.json b/package.json index ca4e1704f..02b5d199a 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "generate:charging-stations": "cd ./assets/layers/charging_station && vite-node csvToJson.ts && cd -", "prepare-deploy": "npm run generate:service-worker && ./scripts/build.sh", "format": "prettier --write '**/*.ts' '**/*.svelte'", - "clean:tests": "(find . -type f -name \"*.doctest.ts\" | xargs -r rm)", + "clean:tests": "find . -type f -name \"*.doctest.ts\" | xargs -r rm", "clean": "rm -rf .cache/ && (find *.html | grep -v \"^\\(404\\|index\\|land\\|test\\|studio\\|theme\\|style_test\\|statistics\\).html\" | xargs -r rm) && (ls | grep \"^index_[a-zA-Z_-]\\+\\.ts$\" | xargs -r rm) && (ls | grep \".*.webmanifest$\" | grep -v \"manifest.webmanifest\" | xargs -r rm)", "generate:dependency-graph": "node_modules/.bin/depcruise --exclude \"^node_modules\" --output-type dot Logic/State/MapState.ts > dependencies.dot && dot dependencies.dot -T svg -o dependencies.svg && rm dependencies.dot", "weblate-add-upstream": "git remote add weblate-github git@github.com:weblate/MapComplete.git && git remote add weblate-hosted-core https://hosted.weblate.org/git/mapcomplete/core/ && git remote add weblate-hosted-layers https://hosted.weblate.org/git/mapcomplete/layers/", diff --git a/scripts/generateCache.ts b/scripts/generateCache.ts index b5d871527..44ac75577 100644 --- a/scripts/generateCache.ts +++ b/scripts/generateCache.ts @@ -1,30 +1,30 @@ /** * Generates a collection of geojson files based on an overpass query for a given theme */ -import { Utils } from "../Utils" -import { Overpass } from "../Logic/Osm/Overpass" +import { Utils } from "../src/Utils" +import { Overpass } from "../src/Logic/Osm/Overpass" import { existsSync, readFileSync, writeFileSync } from "fs" -import { TagsFilter } from "../Logic/Tags/TagsFilter" -import { Or } from "../Logic/Tags/Or" -import { AllKnownLayouts } from "../Customizations/AllKnownLayouts" +import { TagsFilter } from "../src/Logic/Tags/TagsFilter" +import { Or } from "../src/Logic/Tags/Or" +import { AllKnownLayouts } from "../src/Customizations/AllKnownLayouts" import * as OsmToGeoJson from "osmtogeojson" -import MetaTagging from "../Logic/MetaTagging" -import { UIEventSource } from "../Logic/UIEventSource" -import { TileRange, Tiles } from "../Models/TileRange" -import LayoutConfig from "../Models/ThemeConfig/LayoutConfig" +import MetaTagging from "../src/Logic/MetaTagging" +import { UIEventSource } from "../src/Logic/UIEventSource" +import { TileRange, Tiles } from "../src/Models/TileRange" +import LayoutConfig from "../src/Models/ThemeConfig/LayoutConfig" import ScriptUtils from "./ScriptUtils" -import PerLayerFeatureSourceSplitter from "../Logic/FeatureSource/PerLayerFeatureSourceSplitter" -import FilteredLayer from "../Models/FilteredLayer" -import StaticFeatureSource from "../Logic/FeatureSource/Sources/StaticFeatureSource" -import Constants from "../Models/Constants" -import { GeoOperations } from "../Logic/GeoOperations" -import SimpleMetaTaggers, { ReferencingWaysMetaTagger } from "../Logic/SimpleMetaTagger" -import FilteringFeatureSource from "../Logic/FeatureSource/Sources/FilteringFeatureSource" +import PerLayerFeatureSourceSplitter from "../src/Logic/FeatureSource/PerLayerFeatureSourceSplitter" +import FilteredLayer from "../src/Models/FilteredLayer" +import StaticFeatureSource from "../src/Logic/FeatureSource/Sources/StaticFeatureSource" +import Constants from "../src/Models/Constants" +import { GeoOperations } from "../src/Logic/GeoOperations" +import SimpleMetaTaggers, { ReferencingWaysMetaTagger } from "../src/Logic/SimpleMetaTagger" +import FilteringFeatureSource from "../src/Logic/FeatureSource/Sources/FilteringFeatureSource" import { Feature } from "geojson" -import { BBox } from "../Logic/BBox" -import { FeatureSource } from "../Logic/FeatureSource/FeatureSource" -import OsmObjectDownloader from "../Logic/Osm/OsmObjectDownloader" -import FeaturePropertiesStore from "../Logic/FeatureSource/Actors/FeaturePropertiesStore" +import { BBox } from "../src/Logic/BBox" +import { FeatureSource } from "../src/Logic/FeatureSource/FeatureSource" +import OsmObjectDownloader from "../src/Logic/Osm/OsmObjectDownloader" +import FeaturePropertiesStore from "../src/Logic/FeatureSource/Actors/FeaturePropertiesStore" ScriptUtils.fixUtils() diff --git a/test/Logic/Actors/Actors.spec.ts b/test/Logic/Actors/Actors.spec.ts index 2763f6a93..ef31ee319 100644 --- a/test/Logic/Actors/Actors.spec.ts +++ b/test/Logic/Actors/Actors.spec.ts @@ -1,11 +1,11 @@ -import { Utils } from "../../../Utils" -import LayoutConfig from "../../../Models/ThemeConfig/LayoutConfig" +import { Utils } from "../../../src/Utils" +import LayoutConfig from "../../../src/Models/ThemeConfig/LayoutConfig" -import * as bookcaseJson from "../../../assets/generated/themes/bookcases.json" -import { OsmTags } from "../../../Models/OsmFeature" +import * as bookcaseJson from "../../../src/assets/generated/themes/bookcases.json" +import { OsmTags } from "../../../src/Models/OsmFeature" import { Feature, Geometry } from "geojson" import { expect, it } from "vitest" -import ThemeViewState from "../../../Models/ThemeViewState" +import ThemeViewState from "../../../src/Models/ThemeViewState" import ScriptUtils from "../../../scripts/ScriptUtils" const latestTags = { diff --git a/test/Logic/Actors/CreateMultiPolygonWithPointReuseAction.spec.ts b/test/Logic/Actors/CreateMultiPolygonWithPointReuseAction.spec.ts index abbb5beea..2a31cc935 100644 --- a/test/Logic/Actors/CreateMultiPolygonWithPointReuseAction.spec.ts +++ b/test/Logic/Actors/CreateMultiPolygonWithPointReuseAction.spec.ts @@ -1,7 +1,9 @@ -import CreateMultiPolygonWithPointReuseAction from "../../../Logic/Osm/Actions/CreateMultiPolygonWithPointReuseAction" -import { Tag } from "../../../Logic/Tags/Tag" -import { Changes } from "../../../Logic/Osm/Changes" +import CreateMultiPolygonWithPointReuseAction from "../../../src/Logic/Osm/Actions/CreateMultiPolygonWithPointReuseAction" +import { Tag } from "../../../src/Logic/Tags/Tag" +import { Changes } from "../../../src/Logic/Osm/Changes" import { describe, expect, it } from "vitest" +import { OsmConnection } from "../../../src/Logic/Osm/OsmConnection" +import { ImmutableStore } from "../../../src/Logic/UIEventSource" describe("CreateMultiPolygonWithPointReuseAction", () => { it("should produce a correct changeset", () => { @@ -102,7 +104,12 @@ describe("CreateMultiPolygonWithPointReuseAction", () => { [], "import" ) - const descriptions = await action.Perform(new Changes()) + const descriptions = await action.Perform( + new Changes({ + dryRun: new ImmutableStore(true), + osmConnection: new OsmConnection(), + }) + ) const ways = descriptions.filter((d) => d.type === "way") // "unexpected id" diff --git a/test/Logic/ExtraFunctions.spec.ts b/test/Logic/ExtraFunctions.spec.ts index 5f305e122..3759888f7 100644 --- a/test/Logic/ExtraFunctions.spec.ts +++ b/test/Logic/ExtraFunctions.spec.ts @@ -1,5 +1,5 @@ -import { ExtraFuncParams, ExtraFunctions } from "../../Logic/ExtraFunctions" -import { OsmFeature } from "../../Models/OsmFeature" +import { ExtraFuncParams, ExtraFunctions } from "../../src/Logic/ExtraFunctions" +import { OsmFeature } from "../../src/Models/OsmFeature" import { describe, expect, it } from "vitest" import { Feature } from "geojson" diff --git a/test/Logic/GeoOperations.spec.ts b/test/Logic/GeoOperations.spec.ts index f331c9cb6..f06960365 100644 --- a/test/Logic/GeoOperations.spec.ts +++ b/test/Logic/GeoOperations.spec.ts @@ -1,5 +1,5 @@ import * as turf from "@turf/turf" -import { GeoOperations } from "../../Logic/GeoOperations" +import { GeoOperations } from "../../src/Logic/GeoOperations" import { Feature, LineString, Polygon } from "geojson" import { describe, expect, it } from "vitest" diff --git a/test/Logic/ImageProviders/ImageProviders.spec.ts b/test/Logic/ImageProviders/ImageProviders.spec.ts index 3a2a64e7a..2404b0e01 100644 --- a/test/Logic/ImageProviders/ImageProviders.spec.ts +++ b/test/Logic/ImageProviders/ImageProviders.spec.ts @@ -1,6 +1,6 @@ -import AllImageProviders from "../../../Logic/ImageProviders/AllImageProviders" -import { UIEventSource } from "../../../Logic/UIEventSource" -import { Utils } from "../../../Utils" +import AllImageProviders from "../../../src/Logic/ImageProviders/AllImageProviders" +import { UIEventSource } from "../../../src/Logic/UIEventSource" +import { Utils } from "../../../src/Utils" import { describe, expect, it } from "vitest" describe("ImageProviders", () => { diff --git a/test/Logic/OSM/Actions/RelationSplitHandler.spec.ts b/test/Logic/OSM/Actions/RelationSplitHandler.spec.ts index b7aaa805f..fa90eafd3 100644 --- a/test/Logic/OSM/Actions/RelationSplitHandler.spec.ts +++ b/test/Logic/OSM/Actions/RelationSplitHandler.spec.ts @@ -1,14 +1,14 @@ -import { Utils } from "../../../../Utils" -import { OsmRelation } from "../../../../Logic/Osm/OsmObject" +import { Utils } from "../../../../src/Utils" +import { OsmRelation } from "../../../../src/Logic/Osm/OsmObject" import { InPlaceReplacedmentRTSH, TurnRestrictionRSH, -} from "../../../../Logic/Osm/Actions/RelationSplitHandler" -import { Changes } from "../../../../Logic/Osm/Changes" +} from "../../../../src/Logic/Osm/Actions/RelationSplitHandler" +import { Changes } from "../../../../src/Logic/Osm/Changes" import { describe, expect, it } from "vitest" -import OsmObjectDownloader from "../../../../Logic/Osm/OsmObjectDownloader" -import { ImmutableStore } from "../../../../Logic/UIEventSource" -import { OsmConnection } from "../../../../Logic/Osm/OsmConnection" +import OsmObjectDownloader from "../../../../src/Logic/Osm/OsmObjectDownloader" +import { ImmutableStore } from "../../../../src/Logic/UIEventSource" +import { OsmConnection } from "../../../../src/Logic/Osm/OsmConnection" describe("RelationSplitHandler", () => { Utils.injectJsonDownloadForTests("https://www.openstreetmap.org/api/0.6/node/1124134958/ways", { diff --git a/test/Logic/OSM/Actions/ReplaceGeometryAction.spec.ts b/test/Logic/OSM/Actions/ReplaceGeometryAction.spec.ts index 8dc28fa07..94098e525 100644 --- a/test/Logic/OSM/Actions/ReplaceGeometryAction.spec.ts +++ b/test/Logic/OSM/Actions/ReplaceGeometryAction.spec.ts @@ -1,12 +1,12 @@ -import { Utils } from "../../../../Utils" -import LayoutConfig from "../../../../Models/ThemeConfig/LayoutConfig" -import { BBox } from "../../../../Logic/BBox" -import ReplaceGeometryAction from "../../../../Logic/Osm/Actions/ReplaceGeometryAction" +import { Utils } from "../../../../src/Utils" +import LayoutConfig from "../../../../src/Models/ThemeConfig/LayoutConfig" +import { BBox } from "../../../../src/Logic/BBox" +import ReplaceGeometryAction from "../../../../src/Logic/Osm/Actions/ReplaceGeometryAction" import { describe, expect, it } from "vitest" -import { OsmConnection } from "../../../../Logic/Osm/OsmConnection" -import { ImmutableStore } from "../../../../Logic/UIEventSource" -import { Changes } from "../../../../Logic/Osm/Changes" -import FullNodeDatabaseSource from "../../../../Logic/FeatureSource/TiledFeatureSource/FullNodeDatabaseSource" +import { OsmConnection } from "../../../../src/Logic/Osm/OsmConnection" +import { ImmutableStore } from "../../../../src/Logic/UIEventSource" +import { Changes } from "../../../../src/Logic/Osm/Changes" +import FullNodeDatabaseSource from "../../../../src/Logic/FeatureSource/TiledFeatureSource/FullNodeDatabaseSource" describe("ReplaceGeometryAction", () => { const grbStripped = { diff --git a/test/Logic/OSM/Actions/SplitAction.spec.ts b/test/Logic/OSM/Actions/SplitAction.spec.ts index ae8bb25a1..53147d224 100644 --- a/test/Logic/OSM/Actions/SplitAction.spec.ts +++ b/test/Logic/OSM/Actions/SplitAction.spec.ts @@ -1,9 +1,9 @@ -import { Utils } from "../../../../Utils" -import SplitAction from "../../../../Logic/Osm/Actions/SplitAction" -import { Changes } from "../../../../Logic/Osm/Changes" +import { Utils } from "../../../../src/Utils" +import SplitAction from "../../../../src/Logic/Osm/Actions/SplitAction" +import { Changes } from "../../../../src/Logic/Osm/Changes" import { describe, expect, it } from "vitest" -import { OsmConnection } from "../../../../Logic/Osm/OsmConnection" -import { ImmutableStore } from "../../../../Logic/UIEventSource" +import { OsmConnection } from "../../../../src/Logic/Osm/OsmConnection" +import { ImmutableStore } from "../../../../src/Logic/UIEventSource" describe("SplitAction", () => { { diff --git a/test/Logic/OSM/Changes.spec.ts b/test/Logic/OSM/Changes.spec.ts index eb52ccd33..1e8e273e1 100644 --- a/test/Logic/OSM/Changes.spec.ts +++ b/test/Logic/OSM/Changes.spec.ts @@ -1,8 +1,8 @@ -import { ChangeDescription } from "../../../Logic/Osm/Actions/ChangeDescription" -import { Changes } from "../../../Logic/Osm/Changes" +import { ChangeDescription } from "../../../src/Logic/Osm/Actions/ChangeDescription" +import { Changes } from "../../../src/Logic/Osm/Changes" import { expect, it } from "vitest" -import { ImmutableStore } from "../../../Logic/UIEventSource" -import { OsmConnection } from "../../../Logic/Osm/OsmConnection" +import { ImmutableStore } from "../../../src/Logic/UIEventSource" +import { OsmConnection } from "../../../src/Logic/Osm/OsmConnection" it("Generate preXML from changeDescriptions", () => { const changeDescrs: ChangeDescription[] = [ diff --git a/test/Logic/OSM/ChangesetHandler.spec.ts b/test/Logic/OSM/ChangesetHandler.spec.ts index 5d2968f80..e1ff67e50 100644 --- a/test/Logic/OSM/ChangesetHandler.spec.ts +++ b/test/Logic/OSM/ChangesetHandler.spec.ts @@ -1,8 +1,8 @@ -import { Utils } from "../../../Utils" -import { ChangesetHandler, ChangesetTag } from "../../../Logic/Osm/ChangesetHandler" -import { ImmutableStore, UIEventSource } from "../../../Logic/UIEventSource" -import { OsmConnection } from "../../../Logic/Osm/OsmConnection" -import { Changes } from "../../../Logic/Osm/Changes" +import { Utils } from "../../../src/Utils" +import { ChangesetHandler, ChangesetTag } from "../../../src/Logic/Osm/ChangesetHandler" +import { ImmutableStore, UIEventSource } from "../../../src/Logic/UIEventSource" +import { OsmConnection } from "../../../src/Logic/Osm/OsmConnection" +import { Changes } from "../../../src/Logic/Osm/Changes" import { describe, expect, it } from "vitest" function elstorage() { diff --git a/test/Logic/OSM/OsmObject.spec.ts b/test/Logic/OSM/OsmObject.spec.ts index 4d7f838ce..be8c416ef 100644 --- a/test/Logic/OSM/OsmObject.spec.ts +++ b/test/Logic/OSM/OsmObject.spec.ts @@ -1,9 +1,9 @@ -import { OsmObject } from "../../../Logic/Osm/OsmObject" -import { Utils } from "../../../Utils" +import { OsmObject } from "../../../src/Logic/Osm/OsmObject" +import { Utils } from "../../../src/Utils" import ScriptUtils from "../../../scripts/ScriptUtils" import { readFileSync } from "fs" import { describe, expect, it } from "vitest" -import OsmObjectDownloader from "../../../Logic/Osm/OsmObjectDownloader" +import OsmObjectDownloader from "../../../src/Logic/Osm/OsmObjectDownloader" describe("OsmObject", () => { describe("download referencing ways", () => { diff --git a/test/Logic/Tags/LazyMatching.spec.ts b/test/Logic/Tags/LazyMatching.spec.ts index db2d67ee4..dd627b969 100644 --- a/test/Logic/Tags/LazyMatching.spec.ts +++ b/test/Logic/Tags/LazyMatching.spec.ts @@ -1,5 +1,5 @@ -import { TagUtils } from "../../../Logic/Tags/TagUtils" -import { Tag } from "../../../Logic/Tags/Tag" +import { TagUtils } from "../../../src/Logic/Tags/TagUtils" +import { Tag } from "../../../src/Logic/Tags/Tag" import { describe, expect, it } from "vitest" describe("Lazy object properties", () => { diff --git a/test/Logic/Tags/OptimizeTags.spec.ts b/test/Logic/Tags/OptimizeTags.spec.ts index ed90d8d01..2dd4572ff 100644 --- a/test/Logic/Tags/OptimizeTags.spec.ts +++ b/test/Logic/Tags/OptimizeTags.spec.ts @@ -1,9 +1,9 @@ -import { TagsFilter } from "../../../Logic/Tags/TagsFilter" -import { And } from "../../../Logic/Tags/And" -import { Tag } from "../../../Logic/Tags/Tag" -import { TagUtils } from "../../../Logic/Tags/TagUtils" -import { Or } from "../../../Logic/Tags/Or" -import { RegexTag } from "../../../Logic/Tags/RegexTag" +import { TagsFilter } from "../../../src/Logic/Tags/TagsFilter" +import { And } from "../../../src/Logic/Tags/And" +import { Tag } from "../../../src/Logic/Tags/Tag" +import { TagUtils } from "../../../src/Logic/Tags/TagUtils" +import { Or } from "../../../src/Logic/Tags/Or" +import { RegexTag } from "../../../src/Logic/Tags/RegexTag" import { describe, expect, it } from "vitest" describe("Tag optimalization", () => { diff --git a/test/Logic/Tags/TagUtils.spec.ts b/test/Logic/Tags/TagUtils.spec.ts index d16339e63..a6e05e5a9 100644 --- a/test/Logic/Tags/TagUtils.spec.ts +++ b/test/Logic/Tags/TagUtils.spec.ts @@ -1,4 +1,4 @@ -import { TagUtils } from "../../../Logic/Tags/TagUtils" +import { TagUtils } from "../../../src/Logic/Tags/TagUtils" import { equal } from "assert" import { describe, expect, it } from "vitest" diff --git a/test/Logic/Web/Wikidata.spec.ts b/test/Logic/Web/Wikidata.spec.ts index 858de3377..1efbba0ba 100644 --- a/test/Logic/Web/Wikidata.spec.ts +++ b/test/Logic/Web/Wikidata.spec.ts @@ -1,5 +1,5 @@ -import { Utils } from "../../../Utils" -import Wikidata from "../../../Logic/Web/Wikidata" +import { Utils } from "../../../src/Utils" +import Wikidata from "../../../src/Logic/Web/Wikidata" import { describe, expect, it } from "vitest" const Q140 = { diff --git a/test/Models/ThemeConfig/Conversion/CreateNoteImportLayer.spec.ts b/test/Models/ThemeConfig/Conversion/CreateNoteImportLayer.spec.ts index 12499c550..100c5662a 100644 --- a/test/Models/ThemeConfig/Conversion/CreateNoteImportLayer.spec.ts +++ b/test/Models/ThemeConfig/Conversion/CreateNoteImportLayer.spec.ts @@ -1,10 +1,10 @@ -import { Utils } from "../../../../Utils" -import { DesugaringContext } from "../../../../Models/ThemeConfig/Conversion/Conversion" -import { LayerConfigJson } from "../../../../Models/ThemeConfig/Json/LayerConfigJson" -import { TagRenderingConfigJson } from "../../../../Models/ThemeConfig/Json/TagRenderingConfigJson" -import { PrepareLayer } from "../../../../Models/ThemeConfig/Conversion/PrepareLayer" +import { Utils } from "../../../../src/Utils" +import { DesugaringContext } from "../../../../src/Models/ThemeConfig/Conversion/Conversion" +import { LayerConfigJson } from "../../../../src/Models/ThemeConfig/Json/LayerConfigJson" +import { TagRenderingConfigJson } from "../../../../src/Models/ThemeConfig/Json/TagRenderingConfigJson" +import { PrepareLayer } from "../../../../src/Models/ThemeConfig/Conversion/PrepareLayer" import * as bookcases from "../../../../assets/layers/public_bookcase/public_bookcase.json" -import CreateNoteImportLayer from "../../../../Models/ThemeConfig/Conversion/CreateNoteImportLayer" +import CreateNoteImportLayer from "../../../../src/Models/ThemeConfig/Conversion/CreateNoteImportLayer" import { describe, expect, it } from "vitest" describe("CreateNoteImportLayer", () => { diff --git a/test/Models/ThemeConfig/Conversion/FixLegacyTheme.spec.ts b/test/Models/ThemeConfig/Conversion/FixLegacyTheme.spec.ts index c8c6294b5..ce7421c3f 100644 --- a/test/Models/ThemeConfig/Conversion/FixLegacyTheme.spec.ts +++ b/test/Models/ThemeConfig/Conversion/FixLegacyTheme.spec.ts @@ -1,5 +1,5 @@ -import LayoutConfig from "../../../../Models/ThemeConfig/LayoutConfig" -import { FixLegacyTheme } from "../../../../Models/ThemeConfig/Conversion/LegacyJsonConvert" +import LayoutConfig from "../../../../src/Models/ThemeConfig/LayoutConfig" +import { FixLegacyTheme } from "../../../../src/Models/ThemeConfig/Conversion/LegacyJsonConvert" import { describe, expect, it } from "vitest" describe("FixLegacyTheme", () => { diff --git a/test/Models/ThemeConfig/Conversion/PrepareLayer.spec.ts b/test/Models/ThemeConfig/Conversion/PrepareLayer.spec.ts index c26185ea5..6f94b65d6 100644 --- a/test/Models/ThemeConfig/Conversion/PrepareLayer.spec.ts +++ b/test/Models/ThemeConfig/Conversion/PrepareLayer.spec.ts @@ -1,13 +1,13 @@ -import { LayerConfigJson } from "../../../../Models/ThemeConfig/Json/LayerConfigJson" -import { TagRenderingConfigJson } from "../../../../Models/ThemeConfig/Json/TagRenderingConfigJson" -import LineRenderingConfigJson from "../../../../Models/ThemeConfig/Json/LineRenderingConfigJson" +import { LayerConfigJson } from "../../../../src/Models/ThemeConfig/Json/LayerConfigJson" +import { TagRenderingConfigJson } from "../../../../src/Models/ThemeConfig/Json/TagRenderingConfigJson" +import LineRenderingConfigJson from "../../../../src/Models/ThemeConfig/Json/LineRenderingConfigJson" import { ExpandRewrite, PrepareLayer, RewriteSpecial, -} from "../../../../Models/ThemeConfig/Conversion/PrepareLayer" -import { QuestionableTagRenderingConfigJson } from "../../../../Models/ThemeConfig/Json/QuestionableTagRenderingConfigJson" -import RewritableConfigJson from "../../../../Models/ThemeConfig/Json/RewritableConfigJson" +} from "../../../../src/Models/ThemeConfig/Conversion/PrepareLayer" +import { QuestionableTagRenderingConfigJson } from "../../../../src/Models/ThemeConfig/Json/QuestionableTagRenderingConfigJson" +import RewritableConfigJson from "../../../../src/Models/ThemeConfig/Json/RewritableConfigJson" import { describe, expect, it } from "vitest" describe("ExpandRewrite", () => { diff --git a/test/Models/ThemeConfig/Conversion/PrepareTheme.spec.ts b/test/Models/ThemeConfig/Conversion/PrepareTheme.spec.ts index 1904cb2f7..a0f286e78 100644 --- a/test/Models/ThemeConfig/Conversion/PrepareTheme.spec.ts +++ b/test/Models/ThemeConfig/Conversion/PrepareTheme.spec.ts @@ -1,15 +1,15 @@ -import { LayoutConfigJson } from "../../../../Models/ThemeConfig/Json/LayoutConfigJson" -import { LayerConfigJson } from "../../../../Models/ThemeConfig/Json/LayerConfigJson" -import { PrepareTheme } from "../../../../Models/ThemeConfig/Conversion/PrepareTheme" -import { TagRenderingConfigJson } from "../../../../Models/ThemeConfig/Json/TagRenderingConfigJson" -import LayoutConfig from "../../../../Models/ThemeConfig/LayoutConfig" -import bookcaseLayer from "../../../../assets/generated/layers/public_bookcase.json" -import LayerConfig from "../../../../Models/ThemeConfig/LayerConfig" -import { ExtractImages } from "../../../../Models/ThemeConfig/Conversion/FixImages" -import cyclofix from "../../../../assets/generated/themes/cyclofix.json" -import { Tag } from "../../../../Logic/Tags/Tag" -import { DesugaringContext } from "../../../../Models/ThemeConfig/Conversion/Conversion" -import { And } from "../../../../Logic/Tags/And" +import { LayoutConfigJson } from "../../../../src/Models/ThemeConfig/Json/LayoutConfigJson" +import { LayerConfigJson } from "../../../../src/Models/ThemeConfig/Json/LayerConfigJson" +import { PrepareTheme } from "../../../../src/Models/ThemeConfig/Conversion/PrepareTheme" +import { TagRenderingConfigJson } from "../../../../src/Models/ThemeConfig/Json/TagRenderingConfigJson" +import LayoutConfig from "../../../../src/Models/ThemeConfig/LayoutConfig" +import bookcaseLayer from "../../../../src/assets/generated/layers/public_bookcase.json" +import LayerConfig from "../../../../src/Models/ThemeConfig/LayerConfig" +import { ExtractImages } from "../../../../src/Models/ThemeConfig/Conversion/FixImages" +import cyclofix from "../../../../src/assets/generated/themes/cyclofix.json" +import { Tag } from "../../../../src/Logic/Tags/Tag" +import { DesugaringContext } from "../../../../src/Models/ThemeConfig/Conversion/Conversion" +import { And } from "../../../../src/Logic/Tags/And" import { describe, expect, it } from "vitest" const themeConfigJson: LayoutConfigJson = { diff --git a/test/Models/ThemeConfig/SourceConfig.spec.ts b/test/Models/ThemeConfig/SourceConfig.spec.ts index e683adae7..3a1030582 100644 --- a/test/Models/ThemeConfig/SourceConfig.spec.ts +++ b/test/Models/ThemeConfig/SourceConfig.spec.ts @@ -1,5 +1,5 @@ -import SourceConfig from "../../../Models/ThemeConfig/SourceConfig" -import { TagUtils } from "../../../Logic/Tags/TagUtils" +import SourceConfig from "../../../src/Models/ThemeConfig/SourceConfig" +import { TagUtils } from "../../../src/Logic/Tags/TagUtils" import { describe, expect, it } from "vitest" describe("SourceConfig", () => { diff --git a/test/Models/ThemeConfig/TagRenderingConfig.spec.ts b/test/Models/ThemeConfig/TagRenderingConfig.spec.ts index 01c389739..fbf2d2a68 100644 --- a/test/Models/ThemeConfig/TagRenderingConfig.spec.ts +++ b/test/Models/ThemeConfig/TagRenderingConfig.spec.ts @@ -1,5 +1,5 @@ -import TagRenderingConfig from "../../../Models/ThemeConfig/TagRenderingConfig" -import Locale from "../../../UI/i18n/Locale" +import TagRenderingConfig from "../../../src/Models/ThemeConfig/TagRenderingConfig" +import Locale from "../../../src/UI/i18n/Locale" import { describe, expect, it } from "vitest" describe("TagRenderingConfig", () => { diff --git a/test/Models/Units.spec.ts b/test/Models/Units.spec.ts index 51976aa23..95f043a7a 100644 --- a/test/Models/Units.spec.ts +++ b/test/Models/Units.spec.ts @@ -1,5 +1,5 @@ -import { Unit } from "../../Models/Unit" -import { Denomination } from "../../Models/Denomination" +import { Unit } from "../../src/Models/Unit" +import { Denomination } from "../../src/Models/Denomination" import { describe, expect, it } from "vitest" describe("Unit", () => { diff --git a/test/UI/SpecialVisualisations.spec.ts b/test/UI/SpecialVisualisations.spec.ts index 46866666c..1177587ba 100644 --- a/test/UI/SpecialVisualisations.spec.ts +++ b/test/UI/SpecialVisualisations.spec.ts @@ -1,4 +1,4 @@ -import SpecialVisualizations from "../../UI/SpecialVisualizations" +import SpecialVisualizations from "../../src/UI/SpecialVisualizations" import { describe, expect, it } from "vitest" describe("SpecialVisualisations", () => { diff --git a/test/Utils.MinifyJson.spec.ts b/test/Utils.MinifyJson.spec.ts index ec552c6e9..5c758df9b 100644 --- a/test/Utils.MinifyJson.spec.ts +++ b/test/Utils.MinifyJson.spec.ts @@ -1,4 +1,4 @@ -import { Utils } from "../Utils" +import { Utils } from "../src/Utils" import LZString from "lz-string" import { describe, expect, it } from "vitest" diff --git a/test/scripts/GenerateCache.spec.ts b/test/scripts/GenerateCache.spec.ts index 8a83414fa..33a018fa4 100644 --- a/test/scripts/GenerateCache.spec.ts +++ b/test/scripts/GenerateCache.spec.ts @@ -1,4 +1,4 @@ -import { Utils } from "../../Utils" +import { Utils } from "../../src/Utils" import { existsSync, mkdirSync, readFileSync, unlinkSync } from "fs" import ScriptUtils from "../../scripts/ScriptUtils" import { main } from "../../scripts/generateCache" diff --git a/test/testhooks.ts b/test/testhooks.ts index f41868a8f..e0b7c7a4f 100644 --- a/test/testhooks.ts +++ b/test/testhooks.ts @@ -1,8 +1,8 @@ import ScriptUtils from "../scripts/ScriptUtils" -import { Utils } from "../Utils" -import Locale from "../UI/i18n/Locale" +import { Utils } from "../src/Utils" +import Locale from "../src/UI/i18n/Locale" import { beforeEach } from "vitest" -import { ReferencingWaysMetaTagger } from "../Logic/SimpleMetaTagger" +import { ReferencingWaysMetaTagger } from "../src/Logic/SimpleMetaTagger" beforeEach(async () => { ScriptUtils.fixUtils()