17
+  </ion-page>
18
+</template>
19
+
20
+<script setup lang="ts">
21
+import { IonPage, IonHeader, IonToolbar, IonTitle, IonContent } from '@ionic/vue';
22
+import ExploreContainer from '@/components/ExploreContainer.vue';
23
+</script>

+ 23 - 0
src/views/Tab3Page.vue

@@ -0,0 +1,23 @@
1
+<template>
2
+  <ion-page>
3
+    <ion-header>
4
+      <ion-toolbar>
5
+        <ion-title>Tab 3</ion-title>
6
+      </ion-toolbar>
7
+    </ion-header>
8
+    <ion-content :fullscreen="true">
9
+      <ion-header collapse="condense">
10
+        <ion-toolbar>
11
+          <ion-title size="large">Tab 3</ion-title>
12
+        </ion-toolbar>
13
+      </ion-header>
14
+
15
+      <ExploreContainer name="Tab 3 page" />
16
+    </ion-content>
17
+  </ion-page>
18
+</template>
19
+
20
+<script setup lang="ts">
21
+import { IonPage, IonHeader, IonToolbar, IonTitle, IonContent } from '@ionic/vue';
22
+import ExploreContainer from '@/components/ExploreContainer.vue';
23
+</script>

+ 28 - 0
src/views/TabsPage.vue

@@ -0,0 +1,28 @@
1
+<template>
2
+  <ion-page>
3
+    <ion-tabs>
4
+      <ion-router-outlet></ion-router-outlet>
5
+      <ion-tab-bar slot="bottom">
6
+        <ion-tab-button tab="tab1" href="/tabs/tab1">
7
+          <ion-icon aria-hidden="true" :icon="triangle" />
8
+          <ion-label>Tab 1</ion-label>
9
+        </ion-tab-button>
10
+
11
+        <ion-tab-button tab="tab2" href="/tabs/tab2">
12
+          <ion-icon aria-hidden="true" :icon="ellipse" />
13
+          <ion-label>Tab 2</ion-label>
14
+        </ion-tab-button>
15
+
16
+        <ion-tab-button tab="tab3" href="/tabs/tab3">
17
+          <ion-icon aria-hidden="true" :icon="square" />
18
+          <ion-label>Tab 3</ion-label>
19
+        </ion-tab-button>
20
+      </ion-tab-bar>
21
+    </ion-tabs>
22
+  </ion-page>
23
+</template>
24
+
25
+<script setup lang="ts">
26
+import { IonTabBar, IonTabButton, IonTabs, IonLabel, IonIcon, IonPage, IonRouterOutlet } from '@ionic/vue';
27
+import { ellipse, square, triangle } from 'ionicons/icons';
28
+</script>

+ 1 - 0
src/vite-env.d.ts

@@ -0,0 +1 @@
1
+/// <reference types="vite/client" />

+ 5 - 0
tests/e2e/fixtures/example.json

@@ -0,0 +1,5 @@
1
+{
2
+  "name": "Using fixtures to represent data",
3
+  "email": "hello@cypress.io",
4
+  "body": "Fixtures are a great way to mock data for responses to routes"
5
+}

+ 6 - 0
tests/e2e/specs/test.cy.ts

@@ -0,0 +1,6 @@
1
+describe('My First Test', () => {
2
+  it('Visits the app root url', () => {
3
+    cy.visit('/')
4
+    cy.contains('ion-content', 'Tab 1 page')
5
+  })
6
+})

+ 37 - 0
tests/e2e/support/commands.ts

@@ -0,0 +1,37 @@
1
+/// <reference types="cypress" />
2
+// ***********************************************
3
+// This example commands.ts shows you how to
4
+// create various custom commands and overwrite
5
+// existing commands.
6
+//
7
+// For more comprehensive examples of custom
8
+// commands please read more here:
9
+// https://on.cypress.io/custom-commands
10
+// ***********************************************
11
+//
12
+//
13
+// -- This is a parent command --
14
+// Cypress.Commands.add('login', (email, password) => { ... })
15
+//
16
+//
17
+// -- This is a child command --
18
+// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
19
+//
20
+//
21
+// -- This is a dual command --
22
+// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
23
+//
24
+//
25
+// -- This will overwrite an existing command --
26
+// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
27
+//
28
+// declare global {
29
+//   namespace Cypress {
30
+//     interface Chainable {
31
+//       login(email: string, password: string): Chainable<void>
32
+//       drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
33
+//       dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
34
+//       visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
35
+//     }
36
+//   }
37
+// }

+ 20 - 0
tests/e2e/support/e2e.ts

@@ -0,0 +1,20 @@
1
+// ***********************************************************
2
+// This example support/e2e.ts is processed and
3
+// loaded automatically before your test files.
4
+//
5
+// This is a great place to put global configuration and
6
+// behavior that modifies Cypress.
7
+//
8
+// You can change the location of this file or turn off
9
+// automatically serving support files with the
10
+// 'supportFile' configuration option.
11
+//
12
+// You can read more here:
13
+// https://on.cypress.io/configuration
14
+// ***********************************************************
15
+
16
+// Import commands.js using ES2015 syntax:
17
+import './commands'
18
+
19
+// Alternatively you can use CommonJS syntax:
20
+// require('./commands')

+ 10 - 0
tests/unit/example.spec.ts

@@ -0,0 +1,10 @@
1
+import { mount } from '@vue/test-utils'
2
+import Tab1Page from '@/views/Tab1Page.vue'
3
+import { describe, expect, test } from 'vitest'
4
+
5
+describe('Tab1Page.vue', () => {
6
+  test('renders tab 1 Tab1Page', () => {
7
+    const wrapper = mount(Tab1Page)
8
+    expect(wrapper.text()).toMatch('Tab 1 page')
9
+  })
10
+})

+ 21 - 0
tsconfig.json

@@ -0,0 +1,21 @@
1
+{
2
+  "compilerOptions": {
3
+    "target": "ESNext",
4
+    "useDefineForClassFields": true,
5
+    "module": "ESNext",
6
+    "moduleResolution": "Node",
7
+    "strict": true,
8
+    "jsx": "preserve",
9
+    "resolveJsonModule": true,
10
+    "isolatedModules": true,
11
+    "esModuleInterop": true,
12
+    "lib": ["ESNext", "DOM"],
13
+    "skipLibCheck": true,
14
+    "noEmit": true,
15
+    "paths": {
16
+      "@/*": ["./src/*"]
17
+    }
18
+  },
19
+  "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
20
+  "references": [{ "path": "./tsconfig.node.json" }]
21
+}

+ 9 - 0
tsconfig.node.json

@@ -0,0 +1,9 @@
1
+{
2
+  "compilerOptions": {
3
+    "composite": true,
4
+    "module": "ESNext",
5
+    "moduleResolution": "Node",
6
+    "allowSyntheticDefaultImports": true
7
+  },
8
+  "include": ["vite.config.ts"]
9
+}

+ 21 - 0
vite.config.ts

@@ -0,0 +1,21 @@
1
+import legacy from '@vitejs/plugin-legacy'
2
+import vue from '@vitejs/plugin-vue'
3
+import path from 'path'
4
+import { defineConfig } from 'vite'
5
+
6
+// https://vitejs.dev/config/
7
+export default defineConfig({
8
+  plugins: [
9
+    vue(),
10
+    legacy()
11
+  ],
12
+  resolve: {
13
+    alias: {
14
+      '@': path.resolve(__dirname, './src'),
15
+    },
16
+  },
17
+  test: {
18
+    globals: true,
19
+    environment: 'jsdom'
20
+  }
21
+})

Anmelden - Gogs: Simplico Git Service

Anmelden