Skip to content

Commit

Permalink
[studio] change prettier settings #775 (#776)
Browse files Browse the repository at this point in the history
fixed prettier
  • Loading branch information
janavlachova authored Nov 16, 2023
1 parent 95288d9 commit dbde899
Show file tree
Hide file tree
Showing 12 changed files with 70 additions and 73 deletions.
11 changes: 4 additions & 7 deletions agdb_studio/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"$schema": "https://json.schemastore.org/prettierrc",
"semi": false,
"tabWidth": 4,
"singleQuote": true,
"printWidth": 100,
"trailingComma": "none"
}
"$schema": "https://json.schemastore.org/prettierrc",
"tabWidth": 4,
"printWidth": 100
}
10 changes: 5 additions & 5 deletions agdb_studio/e2e/vue.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { test, expect } from '@playwright/test'
import { test, expect } from "@playwright/test";

// See here how to get started:
// https://playwright.dev/docs/intro
test('visits the app root url', async ({ page }) => {
await page.goto('/')
await expect(page.locator('div.greetings > h1')).toHaveText('Main layout')
})
test("visits the app root url", async ({ page }) => {
await page.goto("/");
await expect(page.locator("div.greetings > h1")).toHaveText("Main layout");
});
2 changes: 1 addition & 1 deletion agdb_studio/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { RouterLink, RouterView } from 'vue-router'
import { RouterLink, RouterView } from "vue-router";
</script>

<template>
Expand Down
2 changes: 1 addition & 1 deletion agdb_studio/src/assets/main.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import './base.css';
@import "./base.css";

#app {
max-width: 1280px;
Expand Down
22 changes: 11 additions & 11 deletions agdb_studio/src/components/__tests__/auth/LoginForm.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { describe, it, expect } from 'vitest'
import { mount } from '@vue/test-utils'
import LoginForm from '../../auth/LoginForm.vue'
import { describe, it, expect } from "vitest";
import { mount } from "@vue/test-utils";
import LoginForm from "../../auth/LoginForm.vue";

describe('LoginForm', () => {
it('renders properly', () => {
const wrapper = mount(LoginForm)
expect(wrapper.find('form').exists()).toBe(true)
describe("LoginForm", () => {
it("renders properly", () => {
const wrapper = mount(LoginForm);
expect(wrapper.find("form").exists()).toBe(true);

// Check if both fields exists
expect(wrapper.find('input[type="text"]#username').exists()).toBeTruthy()
expect(wrapper.find('input[type="password"]#password').exists()).toBeTruthy()
})
})
expect(wrapper.find('input[type="text"]#username').exists()).toBeTruthy();
expect(wrapper.find('input[type="password"]#password').exists()).toBeTruthy();
});
});
18 changes: 9 additions & 9 deletions agdb_studio/src/components/__tests__/layout/MainLayout.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { describe, it, expect } from 'vitest'
import { describe, it, expect } from "vitest";

import { mount } from '@vue/test-utils'
import MainLayout from '../../layout/MainLayout.vue'
import { mount } from "@vue/test-utils";
import MainLayout from "../../layout/MainLayout.vue";

describe('MainLayout', () => {
it('renders properly', () => {
const wrapper = mount(MainLayout, { props: { msg: 'Hello Vitest' } })
expect(wrapper.text()).toContain('Main layout')
})
})
describe("MainLayout", () => {
it("renders properly", () => {
const wrapper = mount(MainLayout, { props: { msg: "Hello Vitest" } });
expect(wrapper.text()).toContain("Main layout");
});
});
8 changes: 4 additions & 4 deletions agdb_studio/src/components/auth/LoginForm.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<script lang="ts" setup>
import { ref } from 'vue'
import { ref } from "vue";
const username = ref('')
const password = ref('')
const username = ref("");
const password = ref("");
const login = async () => {
// todo - handle login
}
};
</script>

<template>
Expand Down
18 changes: 9 additions & 9 deletions agdb_studio/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import './assets/main.css'
import "./assets/main.css";

import { createApp } from 'vue'
import { createPinia } from 'pinia'
import { createApp } from "vue";
import { createPinia } from "pinia";

import App from './App.vue'
import router from './router'
import App from "./App.vue";
import router from "./router";

const app = createApp(App)
const app = createApp(App);

app.use(createPinia())
app.use(router)
app.use(createPinia());
app.use(router);

app.mount('#app')
app.mount("#app");
32 changes: 16 additions & 16 deletions agdb_studio/src/router/index.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import LoginView from '@/views/LoginView.vue'
import { createRouter, createWebHistory } from "vue-router";
import HomeView from "../views/HomeView.vue";
import LoginView from "@/views/LoginView.vue";

const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: [
{
path: '/',
name: 'home',
component: HomeView
path: "/",
name: "home",
component: HomeView,
},
{
path: '/about',
name: 'about',
path: "/about",
name: "about",
// route level code-splitting
// this generates a separate chunk (About.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () => import('../views/AboutView.vue')
component: () => import("../views/AboutView.vue"),
},
{
path: '/login',
name: 'login',
component: LoginView
}
]
})
path: "/login",
name: "login",
component: LoginView,
},
],
});

export default router
export default router;
16 changes: 8 additions & 8 deletions agdb_studio/src/stores/counter.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { ref, computed } from 'vue'
import { defineStore } from 'pinia'
import { ref, computed } from "vue";
import { defineStore } from "pinia";

export const useCounterStore = defineStore('counter', () => {
const count = ref(0)
const doubleCount = computed(() => count.value * 2)
export const useCounterStore = defineStore("counter", () => {
const count = ref(0);
const doubleCount = computed(() => count.value * 2);
function increment() {
count.value++
count.value++;
}

return { count, doubleCount, increment }
})
return { count, doubleCount, increment };
});
2 changes: 1 addition & 1 deletion agdb_studio/src/views/HomeView.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import MainLayout from '../components/layout/MainLayout.vue'
import MainLayout from "../components/layout/MainLayout.vue";
</script>

<template>
Expand Down
2 changes: 1 addition & 1 deletion agdb_studio/src/views/LoginView.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts" setup>
import LoginForm from '../components/auth/LoginForm.vue'
import LoginForm from "../components/auth/LoginForm.vue";
</script>

<template>
Expand Down

0 comments on commit dbde899

Please sign in to comment.