Skip to content

Commit

Permalink
Code refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
hiveer committed Jan 6, 2025
1 parent b4d44a2 commit 900b341
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,41 +25,6 @@ vi.mock('../../../stores/UserStore', () => ({

vi.mock('@/packs/useFetchApi', () => ({
default: (url) => ({
post: () => ({
json: () =>
Promise.resolve({
data: { value: { msg: 'Success' } },
error: { value: null }
})
}),
put: () => ({
json: () =>
Promise.resolve({
data: { value: { msg: 'Success' } },
error: { value: null }
})
}),
delete: () => ({
json: () =>
Promise.resolve({
data: { value: null },
error: { value: null }
})
}),
get: () => ({
json: () =>
Promise.resolve({
data: {
value: {
data: {
content: btoa('test content'),
sha: 'test-sha'
}
}
},
error: { value: null }
})
}),
json: () => {
console.log(url)
if (url === '/organization/testorg') {
Expand Down Expand Up @@ -121,12 +86,11 @@ vi.mock('@/packs/useFetchApi', () => ({
}))

describe('OrganizationDetail', () => {
describe('mount', async () => {
describe('mount', () => {
it('mounts correctly', async () => {
const wrapper = createWrapper()
expect(wrapper.exists()).toBe(true)
await wrapper.vm.$nextTick()
console.log(wrapper.vm.organizationData)
expect(wrapper.vm.organizationData).toEqual(
expect.objectContaining({
name: 'testorg',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ vi.mock('@/packs/useFetchApi', () => ({
})
}))

describe('NewOrganization', () => {
describe('OrganizationSettings', () => {
describe('mount', async () => {
it('mounts correctly', async () => {
const wrapper = createWrapper()
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/components/organizations/OrganizationDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@
import { ref, onMounted, watch } from 'vue'
import InviteMember from './InviteMember.vue'
import ProfileRepoList from '../shared/ProfileRepoList.vue'
import { useCookies } from 'vue3-cookies'
import useFetchApi from '../../packs/useFetchApi'
import { ElMessage } from 'element-plus'
import useUserStore from '../../stores/UserStore'
Expand All @@ -126,8 +125,6 @@
})
const membersList = ref([])
const { cookies } = useCookies()
const userStore = useUserStore()
const role = ref('')
Expand Down

0 comments on commit 900b341

Please sign in to comment.