+
+
Map without the global CSS injection
+
+
+
+
+
+
+
diff --git a/test/fixtures/no-inject-css/nuxt.config.ts b/test/fixtures/no-inject-css/nuxt.config.ts
new file mode 100644
index 0000000..bb96881
--- /dev/null
+++ b/test/fixtures/no-inject-css/nuxt.config.ts
@@ -0,0 +1,10 @@
+import NuxtLeaflet from '../../../src/module'
+
+export default defineNuxtConfig({
+ modules: [NuxtLeaflet],
+ leaflet: {
+ injectCss: false,
+ },
+ ssr: false,
+ compatibilityDate: '2024-04-03',
+})
diff --git a/test/fixtures/no-inject-css/package.json b/test/fixtures/no-inject-css/package.json
new file mode 100644
index 0000000..bce8283
--- /dev/null
+++ b/test/fixtures/no-inject-css/package.json
@@ -0,0 +1,5 @@
+{
+ "private": true,
+ "name": "no-inject-css",
+ "type": "module"
+}
diff --git a/test/no-inject-css.test.ts b/test/no-inject-css.test.ts
new file mode 100644
index 0000000..95cc7b5
--- /dev/null
+++ b/test/no-inject-css.test.ts
@@ -0,0 +1,20 @@
+import { fileURLToPath } from 'node:url'
+import { describe, it, expect } from 'vitest'
+import { setup, $fetch, useTestContext } from '@nuxt/test-utils'
+
+describe('nuxt leaflet', async () => {
+ await setup({
+ rootDir: fileURLToPath(new URL('./fixtures/no-inject-css', import.meta.url)),
+ })
+
+ it('renders a basic map without the global CSS injection', async () => {
+ // Get response to a server-rendered page with `$fetch`.
+ const html = await $fetch('/')
+ // Verify there is no error
+ expect(html).toContain(' {
+ expect(useTestContext().nuxt?.options.css).not.toContain('leaflet/dist/leaflet.css')
+ })
+})