Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e6a838708c | ||
|
|
fb72f45e10 | ||
|
|
3893ce2e5c | ||
|
|
147b19d4ff | ||
|
|
9f91522d76 | ||
|
|
bbb3ed25d7 | ||
|
|
81844d6b26 | ||
|
|
75d9af7d92 |
No files matched your search
@@ -12,6 +12,7 @@ jobs:
|
||||
timeout-minutes: 5
|
||||
outputs:
|
||||
web-changed: ${{ steps.check.outputs.web-changed }}
|
||||
full-run: ${{ steps.check.outputs.full-run }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
@@ -23,16 +24,24 @@ jobs:
|
||||
env:
|
||||
PR_TITLE: ${{ github.event.pull_request.title }}
|
||||
run: |
|
||||
# full-run: push to master/stable-* or an explicit [full-ci] request always run
|
||||
# everything, unscoped - same as before Nx. A normal PR gets the affected-scoped
|
||||
# path instead (see web-build-test), since only those two cases actually need every
|
||||
# project checked.
|
||||
if [[ "${{ github.event_name }}" == "push" ]]; then
|
||||
echo "web-changed=true" >> "$GITHUB_OUTPUT"
|
||||
echo "full-run=true" >> "$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if echo "$PR_TITLE" | grep -qi "\[full-ci\]"; then
|
||||
echo "web-changed=true" >> "$GITHUB_OUTPUT"
|
||||
echo "full-run=true" >> "$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "full-run=false" >> "$GITHUB_OUTPUT"
|
||||
|
||||
CHANGED_FILES=$(git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}" 2>/dev/null || git diff --name-only HEAD~1)
|
||||
|
||||
WEB_CHANGED=false
|
||||
@@ -58,6 +67,9 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
# nx affected --base=<pr-base-sha> (used below) needs that commit present locally
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
|
||||
@@ -81,16 +93,34 @@ jobs:
|
||||
run: pnpm licenses:csv && pnpm licenses:save
|
||||
|
||||
- name: Check types
|
||||
# Whole-repo, unconditional: only 5/27 projects have a per-project typecheck target
|
||||
# (nx/vite's typecheck inference needs a project's own vite.config.ts, which most
|
||||
# web-app-* packages don't have - see docs/superpowers/specs), so `nx affected
|
||||
# -t typecheck` can't safely stand in for this yet.
|
||||
run: pnpm check:types
|
||||
|
||||
- name: Check format
|
||||
run: pnpm check:format
|
||||
|
||||
- name: Lint
|
||||
run: pnpm lint
|
||||
env:
|
||||
FULL_RUN: ${{ needs.detect-web-changes.outputs.full-run }}
|
||||
run: |
|
||||
if [[ "$FULL_RUN" == "true" ]]; then
|
||||
pnpm lint
|
||||
else
|
||||
pnpm exec nx affected -t lint --base="${{ github.event.pull_request.base.sha }}"
|
||||
fi
|
||||
|
||||
- name: Run unit tests
|
||||
run: pnpm test:unit --coverage
|
||||
env:
|
||||
FULL_RUN: ${{ needs.detect-web-changes.outputs.full-run }}
|
||||
run: |
|
||||
if [[ "$FULL_RUN" == "true" ]]; then
|
||||
pnpm test:unit --coverage
|
||||
else
|
||||
pnpm exec nx affected -t test --base="${{ github.event.pull_request.base.sha }}"
|
||||
fi
|
||||
|
||||
- name: Build
|
||||
run: pnpm build
|
||||
|
||||
@@ -41,6 +41,10 @@ playwright-report
|
||||
|
||||
/.pnpm-store/
|
||||
|
||||
# Nx local cache
|
||||
.nx/cache
|
||||
.nx/workspace-data
|
||||
|
||||
# drone CI is in .drone.star, do not let someone accidentally commit a local .drone.yml
|
||||
.drone.yml
|
||||
|
||||
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"$schema": "./node_modules/nx/schemas/nx-schema.json",
|
||||
"defaultBase": "master",
|
||||
"namedInputs": {
|
||||
"default": ["{projectRoot}/**/*", "sharedGlobals"],
|
||||
"sharedGlobals": [
|
||||
"{workspaceRoot}/nx.json",
|
||||
"{workspaceRoot}/pnpm-lock.yaml",
|
||||
"{workspaceRoot}/pnpm-workspace.yaml",
|
||||
"{workspaceRoot}/tsconfig.json",
|
||||
"{workspaceRoot}/eslint.config.js",
|
||||
"{workspaceRoot}/vite.config.common.ts",
|
||||
"{workspaceRoot}/vitest.config.ts",
|
||||
"{workspaceRoot}/tests/unit/**/*"
|
||||
]
|
||||
},
|
||||
"plugins": [
|
||||
{
|
||||
"plugin": "@nx/vitest",
|
||||
"exclude": ["vite.config.ts", "vite.config.common.ts", "vite.cern.config.ts"],
|
||||
"options": {
|
||||
"testMode": "run"
|
||||
}
|
||||
},
|
||||
"@nx/eslint/plugin",
|
||||
{
|
||||
"plugin": "@nx/vite/plugin",
|
||||
"exclude": ["vite.config.ts", "vite.config.common.ts", "vite.cern.config.ts"],
|
||||
"options": {
|
||||
"buildTargetName": "nx-vite-build-unused",
|
||||
"serveTargetName": "nx-vite-serve-unused",
|
||||
"devTargetName": "nx-vite-dev-unused",
|
||||
"previewTargetName": "nx-vite-preview-unused",
|
||||
"serveStaticTargetName": "nx-vite-serve-static-unused",
|
||||
"watchDepsTargetName": "nx-vite-watch-deps-unused",
|
||||
"buildDepsTargetName": "nx-vite-build-deps-unused",
|
||||
"typecheckTargetName": "typecheck"
|
||||
}
|
||||
}
|
||||
],
|
||||
"targetDefaults": {
|
||||
"test": {
|
||||
"cache": true,
|
||||
"inputs": ["default", "^default"],
|
||||
"outputs": []
|
||||
}
|
||||
},
|
||||
"analytics": false
|
||||
}
|
||||
@@ -39,6 +39,9 @@
|
||||
"@babel/preset-env": "7.28.5",
|
||||
"@babel/register": "7.28.3",
|
||||
"@noble/hashes": "2.0.1",
|
||||
"@nx/eslint": "23.2.1",
|
||||
"@nx/vite": "23.2.1",
|
||||
"@nx/vitest": "23.2.1",
|
||||
"@ownclouders/babel-preset": "workspace:*",
|
||||
"@ownclouders/eslint-config": "workspace:*",
|
||||
"@ownclouders/prettier-config": "workspace:*",
|
||||
@@ -69,6 +72,7 @@
|
||||
"jsqr": "^1.4.0",
|
||||
"license-checker-rseidelsohn": "4.4.2",
|
||||
"node-fetch": "3.3.2",
|
||||
"nx": "^23.2.1",
|
||||
"pino": "10.1.0",
|
||||
"pino-pretty": "13.1.2",
|
||||
"prettier": "^3.6.2",
|
||||
@@ -102,6 +106,7 @@
|
||||
},
|
||||
"pnpm": {
|
||||
"overrides": {
|
||||
"typescript": "5.9.3",
|
||||
"nanoid": "^3.3.17",
|
||||
"elliptic": "6.6.1",
|
||||
"sha.js": "2.4.12",
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
"main": "src/index.ts",
|
||||
"private": false,
|
||||
"scripts": {
|
||||
"lint": "lint:stylelint",
|
||||
"lint:stylelint": "stylelint './src/styles/**/*.scss' --cache",
|
||||
"tokens": "node build/build-tokens.js",
|
||||
"tokens:w": "onchange -i \"./src/tokens/**/*.json\" -- npm run tokens",
|
||||
@@ -66,6 +65,11 @@
|
||||
"default": "./dist/design-system/helpers.js",
|
||||
"require": "./dist/design-system/helpers.cjs",
|
||||
"types": "./dist/types/helpers/index.d.ts"
|
||||
},
|
||||
"./testing": {
|
||||
"default": "./dist/design-system/testing.js",
|
||||
"require": "./dist/design-system/testing.cjs",
|
||||
"types": "./dist/types/testing/index.d.ts"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -84,6 +88,9 @@
|
||||
},
|
||||
"./l10n": {
|
||||
"default": "./l10n/translations.json"
|
||||
},
|
||||
"./testing": {
|
||||
"default": "./src/testing/index.ts"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
@@ -108,8 +115,8 @@
|
||||
"@babel/plugin-transform-runtime": "7.28.5",
|
||||
"@babel/preset-env": "7.28.5",
|
||||
"@babel/runtime": "7.28.4",
|
||||
"@ownclouders/web-test-helpers": "workspace:*",
|
||||
"@vitejs/plugin-vue": "6.0.1",
|
||||
"@vue/test-utils": "2.4.6",
|
||||
"autoprefixer": "10.4.22",
|
||||
"babel-core": "7.0.0-bridge.0",
|
||||
"babel-loader": "^10.0.0",
|
||||
@@ -141,6 +148,12 @@
|
||||
"yaml": "^2.8.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@vue/test-utils": "^2.4.6",
|
||||
"vue": "^3.5.29"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@vue/test-utils": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import { PartialComponentProps, mount } from '@ownclouders/web-test-helpers'
|
||||
import OcAvatar from './OcAvatar.vue'
|
||||
import { extractInitials } from './extractInitials'
|
||||
import { PartialComponentProps, mount } from '../../testing'
|
||||
|
||||
describe('extractInitials', () => {
|
||||
describe('should allow alphanumeric characters', () => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { shallowMount } from '@ownclouders/web-test-helpers'
|
||||
import Count from './OcAvatarCount.vue'
|
||||
import { shallowMount } from '../../testing'
|
||||
|
||||
describe('OcAvatarCount', () => {
|
||||
it('dynamically calculates font size', () => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import OcAvatarItem from './OcAvatarItem.vue'
|
||||
import { mount } from '@ownclouders/web-test-helpers'
|
||||
import { mount } from '../../testing'
|
||||
describe('OcAvatarItem', () => {
|
||||
function getWrapperWithProps(props = {}) {
|
||||
return mount(OcAvatarItem, {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { shallowMount } from '@ownclouders/web-test-helpers'
|
||||
import Avatars from './OcAvatars.vue'
|
||||
import { shallowMount } from '../../testing'
|
||||
|
||||
const items = [
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { defaultPlugins, shallowMount } from '@ownclouders/web-test-helpers'
|
||||
import Breadcrumb from './OcBreadcrumb.vue'
|
||||
import { defaultPlugins, shallowMount } from '../../testing'
|
||||
|
||||
const items = [
|
||||
{ text: 'First folder', to: { path: 'folder' } },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { PartialComponentProps, defaultPlugins, shallowMount } from '@ownclouders/web-test-helpers'
|
||||
import OcButton from './OcButton.vue'
|
||||
import { PartialComponentProps, defaultPlugins, shallowMount } from '../../testing'
|
||||
|
||||
describe('OcButton', () => {
|
||||
it('should display slot html', () => {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import OcCheckbox from './OcCheckbox.vue'
|
||||
import { PartialComponentProps, mount } from '@ownclouders/web-test-helpers'
|
||||
|
||||
import { PartialComponentProps, mount } from '../../testing'
|
||||
describe('OcCheckbox', () => {
|
||||
function getWrapperWithProps(props: PartialComponentProps<typeof OcCheckbox>) {
|
||||
return mount(OcCheckbox, {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Datepicker from './OcDatepicker.vue'
|
||||
import { ComponentProps, defaultPlugins, shallowMount } from '@ownclouders/web-test-helpers'
|
||||
import { DateTime } from 'luxon'
|
||||
import { nextTick } from 'vue'
|
||||
import { ComponentProps, defaultPlugins, shallowMount } from '../../testing'
|
||||
|
||||
describe('OcDatePicker', () => {
|
||||
it('renders', () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { shallowMount, mount } from '@ownclouders/web-test-helpers'
|
||||
import Drop from './OcDrop.vue'
|
||||
import { getSizeClass } from '../../helpers'
|
||||
import { shallowMount, mount } from '../../testing'
|
||||
|
||||
const dom = ({ position = 'auto', mode = 'click', paddingSize = 'medium' } = {}) => {
|
||||
document.body.innerHTML = ''
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import OcDropzone from './OcDropzone.vue'
|
||||
import { mount } from '@ownclouders/web-test-helpers'
|
||||
|
||||
import { mount } from '../../testing'
|
||||
describe('OcDropzone', () => {
|
||||
const selectors = {
|
||||
dropzone: '.oc-dropzone'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { defaultPlugins, mount } from '@ownclouders/web-test-helpers'
|
||||
import OcFilterChip from './OcFilterChip.vue'
|
||||
import { defaultPlugins, mount } from '../../testing'
|
||||
|
||||
const selectors = {
|
||||
filterChipBtn: '.oc-filter-chip-button',
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import OcGrid from './OcGrid.vue'
|
||||
import { mount } from '@ownclouders/web-test-helpers'
|
||||
|
||||
import { mount } from '../../testing'
|
||||
describe('OcGrid', () => {
|
||||
function getWrapper(props = {}) {
|
||||
return mount(OcGrid, {
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
import OcHiddenAnnouncer from './OcHiddenAnnouncer.vue'
|
||||
import { mount } from '@ownclouders/web-test-helpers'
|
||||
|
||||
import { mount } from '../../testing'
|
||||
describe('OcHiddenAnnouncer', () => {
|
||||
function getWrapper(props = {}) {
|
||||
return mount(OcHiddenAnnouncer, {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { mount } from '@ownclouders/web-test-helpers'
|
||||
import OcIcon from './OcIcon.vue'
|
||||
import { glob } from 'glob'
|
||||
import path from 'path'
|
||||
import { mount } from '../../testing'
|
||||
|
||||
describe('OcIcon', () => {
|
||||
test('render and update', async () => {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import OcImage from './OcImage.vue'
|
||||
import { mount } from '@ownclouders/web-test-helpers'
|
||||
|
||||
import { mount } from '../../testing'
|
||||
// @vitest-environment jsdom
|
||||
describe('OcImage', () => {
|
||||
function getWrapper(props = {}) {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { FocusTrap } from 'focus-trap-vue'
|
||||
import OcDrop from '../OcDrop/OcDrop.vue'
|
||||
import OcInfoDrop from './OcInfoDrop.vue'
|
||||
import { PartialComponentProps, defaultPlugins, shallowMount } from '@ownclouders/web-test-helpers'
|
||||
|
||||
import { PartialComponentProps, defaultPlugins, shallowMount } from '../../testing'
|
||||
describe('OcInfoDrop', () => {
|
||||
function getWrapperWithProps(props: PartialComponentProps<typeof OcInfoDrop>) {
|
||||
return shallowMount(OcInfoDrop, {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import OcLoader from './OcLoader.vue'
|
||||
import { mount } from '@ownclouders/web-test-helpers'
|
||||
|
||||
import { mount } from '../../testing'
|
||||
const selectors = {
|
||||
label: '[data-testid="oc-loader-label"]'
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import OcLogo from './OcLogo.vue'
|
||||
import { shallowMount, mount } from '@ownclouders/web-test-helpers'
|
||||
import OcImage from '../OcImage/OcImage.vue'
|
||||
import { shallowMount, mount } from '../../testing'
|
||||
|
||||
describe('OcLogo', () => {
|
||||
const requiredProps = {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { defaultPlugins, mount, shallowMount } from '@ownclouders/web-test-helpers'
|
||||
import { FocusTrap } from 'focus-trap-vue'
|
||||
import Modal from './OcModal.vue'
|
||||
import OcButton from './../OcButton/OcButton.vue'
|
||||
import { defaultPlugins, mount, shallowMount } from '../../testing'
|
||||
|
||||
const defaultProps = {
|
||||
title: 'Example title',
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
import OcNotificationMessage from './OcNotificationMessage.vue'
|
||||
import { defaultPlugins, mount } from '@ownclouders/web-test-helpers'
|
||||
|
||||
import { defaultPlugins, mount } from '../../testing'
|
||||
describe('OcNotificationMessage', () => {
|
||||
beforeEach(() => {
|
||||
vi.useFakeTimers()
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import OcNotifications from './OcNotifications.vue'
|
||||
import { shallowMount } from '@ownclouders/web-test-helpers'
|
||||
|
||||
import { shallowMount } from '../../testing'
|
||||
describe('OcNotifications', () => {
|
||||
function getWrapper(options = {}) {
|
||||
return shallowMount(OcNotifications, options)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { shallowMount } from '@ownclouders/web-test-helpers'
|
||||
|
||||
import PageSize from './OcPageSize.vue'
|
||||
import { shallowMount } from '../../testing'
|
||||
|
||||
const defaultProps = {
|
||||
options: [100, 500, 1000, 'All'],
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { defaultPlugins, shallowMount, RouteLocation } from '@ownclouders/web-test-helpers'
|
||||
import { mock } from 'vitest-mock-extended'
|
||||
import { RouteLocationPathRaw, RouterLink } from 'vue-router'
|
||||
import Pagination from './OcPagination.vue'
|
||||
import { defaultPlugins, shallowMount, RouteLocation } from '../../testing'
|
||||
|
||||
const defaultProps = {
|
||||
pages: 5,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { shallowMount } from '@ownclouders/web-test-helpers'
|
||||
import Progress from './OcProgress.vue'
|
||||
import { shallowMount } from '../../testing'
|
||||
|
||||
describe('OcProgress', () => {
|
||||
it('sets correct classes', () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import OcRadio from './OcRadio.vue'
|
||||
import { PartialComponentProps, mount } from '@ownclouders/web-test-helpers'
|
||||
import { AvailableSizeType } from '../../helpers'
|
||||
import { PartialComponentProps, mount } from '../../testing'
|
||||
|
||||
describe('OcRadio', () => {
|
||||
function getWrapper(props: PartialComponentProps<typeof OcRadio> = {}) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { defaultPlugins, shallowMount } from '@ownclouders/web-test-helpers'
|
||||
import Recipient from './OcRecipient.vue'
|
||||
import { Recipient as RecipientType } from '../../helpers'
|
||||
import { defaultPlugins, shallowMount } from '../../testing'
|
||||
|
||||
describe('OcRecipient', () => {
|
||||
function getWrapper(props: Partial<RecipientType> = undefined, slot: string = undefined) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { defaultPlugins, mount, shallowMount } from '@ownclouders/web-test-helpers'
|
||||
import OcSearchBar from './OcSearchBar.vue'
|
||||
import { defaultPlugins, mount, shallowMount } from '../../testing'
|
||||
|
||||
describe('OcSearchBar', () => {
|
||||
const selectors = {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { defaultPlugins, mount, PartialComponentProps } from '@ownclouders/web-test-helpers'
|
||||
import OcSelect from './OcSelect.vue'
|
||||
import { defaultPlugins, mount, PartialComponentProps } from '../../testing'
|
||||
|
||||
const selectors = {
|
||||
ocSelect: '.oc-select',
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
import StatusIndicators from './OcStatusIndicators.vue'
|
||||
import { defaultPlugins, mount } from '@ownclouders/web-test-helpers'
|
||||
|
||||
import { defaultPlugins, mount } from '../../testing'
|
||||
const fileResource = {
|
||||
name: 'forest.jpg',
|
||||
path: 'nature/forest.jpg',
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { shallowMount } from '@ownclouders/web-test-helpers'
|
||||
|
||||
import Switch from './OcSwitch.vue'
|
||||
import { shallowMount } from '../../testing'
|
||||
|
||||
const defaultProps = {
|
||||
label: 'Test label'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { defaultPlugins, mount } from '@ownclouders/web-test-helpers'
|
||||
import Table from './OcTable.vue'
|
||||
import { defaultPlugins, mount } from '../../testing'
|
||||
|
||||
const ASC = 'ascending'
|
||||
const DESC = 'descending'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { shallowMount, mount, defaultPlugins } from '@ownclouders/web-test-helpers'
|
||||
import Table from './OcTable.vue'
|
||||
import { shallowMount, mount, defaultPlugins } from '../../testing'
|
||||
|
||||
const fields = [
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { shallowMount } from '@ownclouders/web-test-helpers'
|
||||
import Cell from './OcTableCell.vue'
|
||||
import { shallowMount } from '../../testing'
|
||||
|
||||
describe('OcTableCell', () => {
|
||||
it('Uses correct element', () => {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { shallowMount } from '@ownclouders/web-test-helpers'
|
||||
|
||||
import Table from './OcTableSimple.vue'
|
||||
import { shallowMount } from '../../testing'
|
||||
|
||||
describe('OcTableSimple', () => {
|
||||
it('adds hover', () => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { shallowMount } from '@ownclouders/web-test-helpers'
|
||||
import Tag from './OcTag.vue'
|
||||
import { shallowMount } from '../../testing'
|
||||
|
||||
describe('OcTag', () => {
|
||||
it('uses correct component when type is specified', () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { shallowMount, mount, defaultPlugins } from '@ownclouders/web-test-helpers'
|
||||
import OcTextInput from './OcTextInput.vue'
|
||||
import { PasswordPolicy } from '../../helpers'
|
||||
import { mock } from 'vitest-mock-extended'
|
||||
import { shallowMount, mount, defaultPlugins } from '../../testing'
|
||||
|
||||
interface Props {
|
||||
id?: string
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { shallowMount } from '@ownclouders/web-test-helpers'
|
||||
import OcTextarea from './OcTextarea.vue'
|
||||
import { shallowMount } from '../../testing'
|
||||
|
||||
const defaultProps = {
|
||||
label: 'label'
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { ref, nextTick } from 'vue'
|
||||
import { useIsVisible } from './index'
|
||||
import { mount } from '@ownclouders/web-test-helpers'
|
||||
|
||||
import { mount } from '../../testing'
|
||||
const mockIntersectionObserver = () => {
|
||||
const enable = () => {
|
||||
const mock = {
|
||||
|
||||
@@ -12,7 +12,11 @@ const initializeCustomProps = (tokens: string[] = [], prefix: string) => {
|
||||
|
||||
export default {
|
||||
install(app: App, options: any = {}) {
|
||||
import('./utils/webFontLoader')
|
||||
// Fire-and-forget, so nothing awaits the rejection: webfonts are cosmetic, and failing to
|
||||
// load them must not surface as an unhandled rejection. Under vitest this import can still
|
||||
// be in flight when the test environment is torn down, which rejects with
|
||||
// `EnvironmentTeardownError`.
|
||||
import('./utils/webFontLoader').catch(() => {})
|
||||
|
||||
const themeOptions = options.tokens
|
||||
initializeCustomProps(themeOptions?.breakpoints, 'breakpoint-')
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
import { App, Plugin, h } from 'vue'
|
||||
import { createGettext } from 'vue3-gettext'
|
||||
import DesignSystem from '../index'
|
||||
|
||||
/**
|
||||
* Test helpers for mounting components that render design system components (`<oc-button>`,
|
||||
* `<oc-icon>`, ...). Those are registered globally by this package's Vue plugin, so anything
|
||||
* that mounts them has to install it first.
|
||||
*
|
||||
* They live here rather than in a dedicated test-helper package because `design-system` sits at
|
||||
* the bottom of the workspace package graph: it cannot depend on a package that installs it
|
||||
* without forming a cycle - which is exactly what {design-system, web-pkg, web-test-helpers}
|
||||
* used to be.
|
||||
*
|
||||
* `@ownclouders/web-pkg/src/testing` builds on this and adds what its own components need
|
||||
* (pinia stores, casl abilities); `@ownclouders/web-test-helpers` re-exports that in turn.
|
||||
* Only `design-system`'s own specs should import from here - everything else uses
|
||||
* `@ownclouders/web-test-helpers`.
|
||||
*/
|
||||
|
||||
export { mount, shallowMount, flushPromises, VueWrapper, RouterLinkStub } from '@vue/test-utils'
|
||||
export type { RouteLocation } from 'vue-router'
|
||||
|
||||
type DefinedComponent = new (...args: any[]) => any
|
||||
export type ComponentProps<T extends DefinedComponent> = InstanceType<T>['$props']
|
||||
export type PartialComponentProps<T extends DefinedComponent> = Partial<ComponentProps<T>>
|
||||
|
||||
export interface DesignSystemPluginsOptions {
|
||||
designSystem?: boolean
|
||||
gettext?: boolean
|
||||
getTextDefaultLanguage?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Stubs `<router-link>` so components can render links without a real router instance.
|
||||
*/
|
||||
export const routerLinkStubPlugin: Plugin = {
|
||||
install(app: App) {
|
||||
app.component('RouterLink', {
|
||||
name: 'RouterLink',
|
||||
props: {
|
||||
tag: { type: String, default: 'a' },
|
||||
to: { type: [String, Object], default: '' }
|
||||
},
|
||||
setup(props) {
|
||||
let path = props.to
|
||||
|
||||
if (!!path && typeof path !== 'string') {
|
||||
path = props.to.path || props.to.name
|
||||
|
||||
if (props.to.params) {
|
||||
path += '/' + Object.values(props.to.params).join('/')
|
||||
}
|
||||
|
||||
if (props.to.query) {
|
||||
path += '?' + Object.values(props.to.query).join('&')
|
||||
}
|
||||
}
|
||||
|
||||
return () => h(props.tag, { attrs: { href: path } })
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export const defaultPlugins = ({
|
||||
designSystem = true,
|
||||
gettext = true,
|
||||
getTextDefaultLanguage = 'en'
|
||||
}: DesignSystemPluginsOptions = {}): Plugin[] => {
|
||||
const plugins: Plugin[] = []
|
||||
|
||||
if (designSystem) {
|
||||
plugins.push(DesignSystem as unknown as Plugin)
|
||||
}
|
||||
|
||||
if (gettext) {
|
||||
plugins.push(
|
||||
createGettext({ translations: {}, silent: true, defaultLanguage: getTextDefaultLanguage })
|
||||
)
|
||||
}
|
||||
|
||||
plugins.push(routerLinkStubPlugin)
|
||||
|
||||
return plugins
|
||||
}
|
||||
@@ -30,7 +30,8 @@ export default defineConfig({
|
||||
'design-system': resolve(__dirname, 'src/index.ts'),
|
||||
'design-system/components': resolve(__dirname, 'src/components/index.ts'),
|
||||
'design-system/composables': resolve(__dirname, 'src/composables/index.ts'),
|
||||
'design-system/helpers': resolve(__dirname, 'src/helpers/index.ts')
|
||||
'design-system/helpers': resolve(__dirname, 'src/helpers/index.ts'),
|
||||
'design-system/testing': resolve(__dirname, 'src/testing/index.ts')
|
||||
}
|
||||
},
|
||||
rollupOptions: {
|
||||
|
||||
+2
-1
@@ -30,7 +30,8 @@ describe('Resource Upload Component', () => {
|
||||
it('should call "triggerUpload"', async () => {
|
||||
const { wrapper } = getWrapper()
|
||||
|
||||
const spyTriggerUpload = vi.spyOn(wrapper.vm, 'triggerUpload')
|
||||
// triggerUpload is a <script setup> binding, not part of the public instance type
|
||||
const spyTriggerUpload = vi.spyOn(wrapper.vm as any, 'triggerUpload')
|
||||
const uploadButton = wrapper.find('button')
|
||||
const fileUploadInput = wrapper.find('#files-file-upload-input')
|
||||
|
||||
|
||||
@@ -25,6 +25,11 @@
|
||||
"import": "./dist/web-pkg.js",
|
||||
"require": "./dist/web-pkg.umd.cjs",
|
||||
"types": "./dist/types/index.d.ts"
|
||||
},
|
||||
"./src/testing": {
|
||||
"import": "./dist/web-pkg-testing.js",
|
||||
"require": "./dist/web-pkg-testing.umd.cjs",
|
||||
"types": "./dist/types/testing/index.d.ts"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -42,6 +47,7 @@
|
||||
"@ownclouders/design-system": "workspace:^",
|
||||
"@ownclouders/web-client": "workspace:^",
|
||||
"@pdf-lib/fontkit": "^1.1.1",
|
||||
"@pinia/testing": "^1.0.3",
|
||||
"@sentry/vue": "10.51.0",
|
||||
"@uppy/core": "5.2.0",
|
||||
"@uppy/drop-target": "4.1.0",
|
||||
@@ -76,13 +82,13 @@
|
||||
"qs": "^6.15.2",
|
||||
"screenfull": "^6.0.2",
|
||||
"uuid": "^14.0.0",
|
||||
"vitest-mock-extended": "3.1.1",
|
||||
"vue-concurrency": "^5.0.3",
|
||||
"vue-router": "^5.0.6",
|
||||
"vue3-gettext": "^4.0.1",
|
||||
"zod": "^4.3.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ownclouders/web-test-helpers": "workspace:^",
|
||||
"@types/lodash-es": "4.17.12",
|
||||
"@vitest/web-worker": "4.1.5",
|
||||
"clean-publish": "6.0.1",
|
||||
|
||||
+2
-3
@@ -6,11 +6,10 @@ import {
|
||||
PasswordPolicyService,
|
||||
PreviewService,
|
||||
UppyService
|
||||
} from '@ownclouders/web-pkg'
|
||||
} from '../index'
|
||||
import { Router, RouteLocationNormalizedLoaded, RouteLocationRaw } from 'vue-router'
|
||||
import { computed } from 'vue'
|
||||
import { writable } from '../helpers'
|
||||
|
||||
import { writable } from '.'
|
||||
export interface ComponentMocksOptions {
|
||||
currentRoute?: RouteLocationNormalizedLoaded
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import { App, Plugin } from 'vue'
|
||||
import { abilitiesPlugin } from '@casl/vue'
|
||||
import { createMongoAbility } from '@casl/ability'
|
||||
import { AbilityRule } from '@ownclouders/web-client'
|
||||
import {
|
||||
defaultPlugins as designSystemPlugins,
|
||||
DesignSystemPluginsOptions
|
||||
} from '@ownclouders/design-system/testing'
|
||||
import { createMockStore, PiniaMockOptions } from './pinia'
|
||||
|
||||
// Extends the design system's mount plugins (design system itself + gettext + a `<router-link>`
|
||||
// stub) with what web-pkg's own components need on top: casl abilities and mocked pinia stores.
|
||||
// The design system half is defined once, in `@ownclouders/design-system/testing`, because that
|
||||
// package needs it for its own specs and cannot depend on this one.
|
||||
export interface DefaultPluginsOptions extends DesignSystemPluginsOptions {
|
||||
abilities?: AbilityRule[]
|
||||
pinia?: boolean
|
||||
piniaOptions?: PiniaMockOptions
|
||||
}
|
||||
|
||||
export const defaultPlugins = ({
|
||||
abilities = [],
|
||||
pinia = true,
|
||||
piniaOptions = {},
|
||||
...designSystemOptions
|
||||
}: DefaultPluginsOptions = {}): Plugin[] => [
|
||||
{
|
||||
install(app: App) {
|
||||
app.use(abilitiesPlugin, createMongoAbility(abilities))
|
||||
}
|
||||
},
|
||||
...designSystemPlugins(designSystemOptions),
|
||||
...(pinia ? [createMockStore(piniaOptions)] : [])
|
||||
]
|
||||
File renamed without changes.
+18
-9
@@ -1,10 +1,25 @@
|
||||
import { mount, VueWrapper } from '@vue/test-utils'
|
||||
import { defineComponent, nextTick } from 'vue'
|
||||
import { createRouter as _createRouter, createMemoryHistory, RouterOptions } from 'vue-router'
|
||||
import {
|
||||
mount,
|
||||
shallowMount,
|
||||
flushPromises,
|
||||
VueWrapper,
|
||||
RouterLinkStub,
|
||||
routerLinkStubPlugin
|
||||
} from '@ownclouders/design-system/testing'
|
||||
import type {
|
||||
RouteLocation,
|
||||
ComponentProps,
|
||||
PartialComponentProps
|
||||
} from '@ownclouders/design-system/testing'
|
||||
import { defaultPlugins, DefaultPluginsOptions } from './defaultPlugins'
|
||||
export { mount, shallowMount, flushPromises, VueWrapper } from '@vue/test-utils'
|
||||
|
||||
vi.spyOn(console, 'warn').mockImplementation(() => undefined)
|
||||
// Generic mount helpers and prop types live in `@ownclouders/design-system/testing`, since that
|
||||
// package sits below this one and cannot import from it. Re-exported here so consumers get the
|
||||
// full set from a single entrypoint.
|
||||
export { mount, shallowMount, flushPromises, VueWrapper, RouterLinkStub, routerLinkStubPlugin }
|
||||
export type { RouteLocation, ComponentProps, PartialComponentProps }
|
||||
|
||||
export const getComposableWrapper = <T>(
|
||||
setup: (...args: any[]) => T,
|
||||
@@ -53,8 +68,6 @@ export const getOcSelectOptions = async (
|
||||
return optionElements
|
||||
}
|
||||
|
||||
export type { RouteLocation } from 'vue-router'
|
||||
export { RouterLinkStub } from '@vue/test-utils'
|
||||
export const createRouter = (options?: Partial<RouterOptions>) =>
|
||||
_createRouter({
|
||||
history: createMemoryHistory(),
|
||||
@@ -76,7 +89,3 @@ export const nextTicks = async (amount: number) => {
|
||||
await nextTick()
|
||||
}
|
||||
}
|
||||
|
||||
type DefinedComponent = new (...args: any[]) => any
|
||||
export type ComponentProps<T extends DefinedComponent> = InstanceType<T>['$props']
|
||||
export type PartialComponentProps<T extends DefinedComponent> = Partial<ComponentProps<T>>
|
||||
File renamed without changes.
+2
@@ -1,5 +1,7 @@
|
||||
export * from './defaultComponentMocks'
|
||||
export * from './defaultPlugins'
|
||||
export * from './defaultStubs'
|
||||
export * from './helpers'
|
||||
export * from './httpResponse'
|
||||
export * from './pinia'
|
||||
export * from './useAppDefaultsMock'
|
||||
+1
-1
@@ -10,7 +10,7 @@ import {
|
||||
Modal,
|
||||
OptionsConfig,
|
||||
WebThemeType
|
||||
} from '@ownclouders/web-pkg'
|
||||
} from '../index'
|
||||
import {
|
||||
CollaboratorShare,
|
||||
LinkShare,
|
||||
File renamed without changes.
+1
-1
@@ -1,6 +1,6 @@
|
||||
import { mock } from 'vitest-mock-extended'
|
||||
import { ref } from 'vue'
|
||||
import { FileContext, useAppDefaults, AppConfigObject } from '@ownclouders/web-pkg'
|
||||
import { FileContext, useAppDefaults, AppConfigObject } from '../index'
|
||||
import { FileResource, Resource } from '@ownclouders/web-client'
|
||||
import { GetFileContentsResponse } from '@ownclouders/web-client/webdav'
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import { mock } from 'vitest-mock-extended'
|
||||
import { useGetMatchingSpace } from '@ownclouders/web-pkg'
|
||||
import { useGetMatchingSpace } from '../index'
|
||||
import { SpaceResource } from '@ownclouders/web-client'
|
||||
|
||||
export const useGetMatchingSpaceMock = (
|
||||
@@ -1,4 +1,4 @@
|
||||
import { defaultComponentMocks, defaultPlugins, shallowMount } from '@ownclouders/web-test-helpers'
|
||||
import { defaultComponentMocks, defaultPlugins, shallowMount } from '../../../src/testing'
|
||||
import AppBanner from '../../../src/components/AppBanner.vue'
|
||||
import { createMemoryHistory, createRouter } from 'vue-router'
|
||||
import { useLocalStorage, useSessionStorage } from '@vueuse/core'
|
||||
|
||||
@@ -5,10 +5,10 @@ import { Resource, SpaceResource } from '@ownclouders/web-client'
|
||||
import {
|
||||
defaultComponentMocks,
|
||||
defaultPlugins,
|
||||
shallowMount,
|
||||
PartialComponentProps,
|
||||
RouteLocation,
|
||||
PartialComponentProps
|
||||
} from '@ownclouders/web-test-helpers'
|
||||
shallowMount
|
||||
} from '../../../../src/testing'
|
||||
import { ArchiverService } from '../../../../src/services'
|
||||
import { FolderView } from '../../../../src/ui/types'
|
||||
import { useExtensionRegistry, ViewOptions } from '../../../../src'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import CreateSpace from '../../../../src/components/AppBar/CreateSpace.vue'
|
||||
import { mockDeep } from 'vitest-mock-extended'
|
||||
import { Resource, SpaceResource } from '@ownclouders/web-client'
|
||||
import { defaultPlugins, mount, defaultComponentMocks } from '@ownclouders/web-test-helpers'
|
||||
import { defaultComponentMocks, defaultPlugins, mount } from '../../../../src/testing'
|
||||
import { useMessages, useModals, useSpacesStore } from '../../../../src/composables'
|
||||
import { unref } from 'vue'
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import ErrorScreen from '../../../../src/components/AppTemplates/PartialViews/ErrorScreen.vue'
|
||||
import { defaultPlugins, mount } from '@ownclouders/web-test-helpers'
|
||||
|
||||
import { defaultPlugins, mount } from '../../../../src/testing'
|
||||
describe('The external app error screen component', () => {
|
||||
test('displays an icon and a paragraph', () => {
|
||||
const wrapper = mount(ErrorScreen, {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import LoadingScreen from '../../../../src/components/AppTemplates/PartialViews/LoadingScreen.vue'
|
||||
import { defaultPlugins, mount } from '@ownclouders/web-test-helpers'
|
||||
|
||||
import { defaultPlugins, mount } from '../../../../src/testing'
|
||||
describe('The external app loading screen component', () => {
|
||||
test('displays a spinner and a paragraph', () => {
|
||||
const wrapper = mount(LoadingScreen, {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { mock } from 'vitest-mock-extended'
|
||||
import {
|
||||
RouteLocation,
|
||||
defaultComponentMocks,
|
||||
defaultPlugins,
|
||||
RouteLocation,
|
||||
shallowMount,
|
||||
useGetMatchingSpaceMock
|
||||
} from '@ownclouders/web-test-helpers'
|
||||
} from '../../../src/testing'
|
||||
import { Resource, SpaceResource } from '@ownclouders/web-client'
|
||||
import AppTopBar from '../../../src/components/AppTopBar.vue'
|
||||
import { Action } from '../../../src/composables/actions'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { PartialComponentProps, defaultPlugins, mount } from '@ownclouders/web-test-helpers'
|
||||
import { defaultPlugins, mount, PartialComponentProps } from '../../../src/testing'
|
||||
import { mock } from 'vitest-mock-extended'
|
||||
import { Resource } from '@ownclouders/web-client'
|
||||
import BatchActions from '../../../src/components/BatchActions.vue'
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import ActionMenuItem from '../../../../src/components/ContextActions/ActionMenuItem.vue'
|
||||
import { FileAction } from '../../../../src/composables/actions'
|
||||
import { defaultPlugins, mount, shallowMount } from '@ownclouders/web-test-helpers'
|
||||
|
||||
import { defaultPlugins, mount, shallowMount } from '../../../../src/testing'
|
||||
const selectors = {
|
||||
handler: '[data-testid="action-handler"]',
|
||||
icon: '[data-testid="action-icon"]',
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import ContextActionMenu from '../../../../src/components/ContextActions/ContextActionMenu.vue'
|
||||
import { Action } from '../../../../src/composables/actions'
|
||||
import { defaultPlugins, shallowMount } from '@ownclouders/web-test-helpers'
|
||||
|
||||
import { defaultPlugins, shallowMount } from '../../../../src/testing'
|
||||
describe('ContextActionMenu component', () => {
|
||||
it('renders the menu with actions', () => {
|
||||
const menuSections = [
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
import ContextMenuQuickAction from '../../../../src/components/ContextActions/ContextMenuQuickAction.vue'
|
||||
import { defaultPlugins, mount } from '@ownclouders/web-test-helpers'
|
||||
|
||||
import { defaultPlugins, mount } from '../../../../src/testing'
|
||||
describe('ContextMenuQuickAction component', () => {
|
||||
it('renders component', () => {
|
||||
const { wrapper } = getWrapper()
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
import CreateLinkModal from '../../../src/components/CreateLinkModal.vue'
|
||||
import {
|
||||
ComponentProps,
|
||||
defaultComponentMocks,
|
||||
defaultPlugins,
|
||||
mount
|
||||
} from '@ownclouders/web-test-helpers'
|
||||
import { ComponentProps, defaultComponentMocks, defaultPlugins, mount } from '../../../src/testing'
|
||||
import { mock } from 'vitest-mock-extended'
|
||||
import { PasswordPolicyService } from '../../../src/services'
|
||||
import { usePasswordPolicyService } from '../../../src/composables/passwordPolicyService'
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
mockHttpError,
|
||||
RouteLocation,
|
||||
shallowMount
|
||||
} from '@ownclouders/web-test-helpers'
|
||||
} from '../../../src/testing'
|
||||
import { SpaceResource } from '@ownclouders/web-client'
|
||||
import { mock } from 'vitest-mock-extended'
|
||||
import { FileResource } from '@ownclouders/web-client'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import CustomComponentTarget from '../../../src/components/CustomComponentTarget.vue'
|
||||
import { defaultComponentMocks, defaultPlugins, mount } from '@ownclouders/web-test-helpers'
|
||||
import { defaultComponentMocks, defaultPlugins, mount } from '../../../src/testing'
|
||||
import {
|
||||
CustomComponentExtension,
|
||||
Extension,
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
import {
|
||||
defaultComponentMocks,
|
||||
defaultPlugins,
|
||||
defaultStubs,
|
||||
mount
|
||||
} from '@ownclouders/web-test-helpers'
|
||||
import { defaultComponentMocks, defaultPlugins, defaultStubs, mount } from '../../../../src/testing'
|
||||
import { mock } from 'vitest-mock-extended'
|
||||
import { Resource, SpaceResource } from '@ownclouders/web-client'
|
||||
import ContextActions from '../../../../src/components/FilesList/ContextActions.vue'
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { shallowMount } from '@ownclouders/web-test-helpers'
|
||||
import { AVAILABLE_SIZES } from '@ownclouders/design-system/helpers'
|
||||
import ResourceIcon from '../../../../src/components/FilesList/ResourceIcon.vue'
|
||||
import {
|
||||
@@ -6,6 +5,7 @@ import {
|
||||
resourceIconMappingInjectionKey
|
||||
} from '../../../../src/helpers/resource'
|
||||
import { Resource } from '@ownclouders/web-client'
|
||||
import { shallowMount } from '../../../../src/testing'
|
||||
|
||||
const resourceIconMapping: ResourceIconMapping = {
|
||||
extension: {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { defaultComponentMocks, defaultPlugins, mount } from '@ownclouders/web-test-helpers'
|
||||
import { defaultComponentMocks, defaultPlugins, mount } from '../../../../src/testing'
|
||||
import ResourceListItem from '../../../../src/components/FilesList/ResourceListItem.vue'
|
||||
import { HIDDEN_FILE_EXTENSIONS, Resource } from '@ownclouders/web-client'
|
||||
import { mock } from 'vitest-mock-extended'
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { shallowMount } from '@ownclouders/web-test-helpers'
|
||||
|
||||
import Name from '../../../../src/components/FilesList/ResourceName.vue'
|
||||
import { shallowMount } from '../../../../src/testing'
|
||||
|
||||
const fullPath = 'images/nature/forest.jpg'
|
||||
const name = 'forest.jpg'
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { defaultPlugins, shallowMount } from '@ownclouders/web-test-helpers'
|
||||
import { defaultPlugins, shallowMount } from '../../../../src/testing'
|
||||
import ResourceStatusIndicators from '../../../../src/components/FilesList/ResourceStatusIndicators.vue'
|
||||
import { Resource, SpaceResource } from '@ownclouders/web-client'
|
||||
import { mock } from 'vitest-mock-extended'
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
ShareTypes,
|
||||
SpaceResource
|
||||
} from '@ownclouders/web-client'
|
||||
import { defaultPlugins, mount, PartialComponentProps } from '@ownclouders/web-test-helpers'
|
||||
import { defaultPlugins, mount, PartialComponentProps } from '../../../../src/testing'
|
||||
import {
|
||||
CapabilityStore,
|
||||
useResourcesStore,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { defaultPlugins, shallowMount } from '@ownclouders/web-test-helpers'
|
||||
import { defaultPlugins, shallowMount } from '../../../../src/testing'
|
||||
import { RouteLocationRaw } from 'vue-router'
|
||||
import { SpaceResource, Resource } from '@ownclouders/web-client'
|
||||
import ResourceTile from '../../../../src/components/FilesList/ResourceTile.vue'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { defaultComponentMocks, defaultPlugins, mount } from '@ownclouders/web-test-helpers'
|
||||
import { defaultComponentMocks, defaultPlugins, mount } from '../../../../src/testing'
|
||||
import ResourceTiles from '../../../../src/components/FilesList/ResourceTiles.vue'
|
||||
import { sortFields } from '../../../../src/helpers/ui/resourceTiles'
|
||||
import { Resource, SpaceResource } from '@ownclouders/web-client'
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import DateFilter from '../../../../src/components/Filters/DateFilter.vue'
|
||||
import {
|
||||
PartialComponentProps,
|
||||
defaultComponentMocks,
|
||||
defaultPlugins,
|
||||
mount
|
||||
} from '@ownclouders/web-test-helpers'
|
||||
mount,
|
||||
PartialComponentProps
|
||||
} from '../../../../src/testing'
|
||||
import { queryItemAsString } from '../../../../src/composables/appDefaults'
|
||||
import { DateTime } from 'luxon'
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
defaultPlugins,
|
||||
mount,
|
||||
PartialComponentProps
|
||||
} from '@ownclouders/web-test-helpers'
|
||||
} from '../../../../src/testing'
|
||||
import { queryItemAsString } from '../../../../src/composables/appDefaults'
|
||||
import { mock } from 'vitest-mock-extended'
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import ItemFilter from '../../../src/components/ItemFilter.vue'
|
||||
import {
|
||||
PartialComponentProps,
|
||||
defaultComponentMocks,
|
||||
defaultPlugins,
|
||||
mount
|
||||
} from '@ownclouders/web-test-helpers'
|
||||
mount,
|
||||
PartialComponentProps
|
||||
} from '../../../src/testing'
|
||||
import { queryItemAsString } from '../../../src/composables/appDefaults'
|
||||
import { OcCheckbox } from '@ownclouders/design-system/components'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import ItemFilterToggle from '../../../src/components/ItemFilterToggle.vue'
|
||||
import { defaultComponentMocks, defaultPlugins, mount } from '@ownclouders/web-test-helpers'
|
||||
import { defaultComponentMocks, defaultPlugins, mount } from '../../../src/testing'
|
||||
import { queryItemAsString } from '../../../src/composables/appDefaults'
|
||||
|
||||
vi.mock('../../../src/composables/appDefaults', () => ({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import LinkRoleDropdown from '../../../src/components/LinkRoleDropdown.vue'
|
||||
import { defaultComponentMocks, defaultPlugins, mount } from '@ownclouders/web-test-helpers'
|
||||
import { defaultComponentMocks, defaultPlugins, mount } from '../../../src/testing'
|
||||
import { mock } from 'vitest-mock-extended'
|
||||
import { ShareRole } from '@ownclouders/web-client'
|
||||
import { SharingLinkType } from '@ownclouders/web-client/graph/generated'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import LoadingIndicator from '../../../src/components/LoadingIndicator.vue'
|
||||
import { defaultPlugins, shallowMount } from '@ownclouders/web-test-helpers'
|
||||
import { defaultPlugins, shallowMount } from '../../../src/testing'
|
||||
import { mock } from 'vitest-mock-extended'
|
||||
import { LoadingService } from '../../../src/services'
|
||||
import { OcProgress } from '@ownclouders/design-system/components'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import ExportAsPdfModal from '../../../../src/components/Modals/ExportAsPdfModal.vue'
|
||||
import { defaultComponentMocks, defaultPlugins, shallowMount } from '@ownclouders/web-test-helpers'
|
||||
import { defaultComponentMocks, defaultPlugins, shallowMount } from '../../../../src/testing'
|
||||
import { mock } from 'vitest-mock-extended'
|
||||
import { Resource, SpaceResource } from '@ownclouders/web-client'
|
||||
import { Modal, useMessages, useModals } from '../../../../src/composables/piniaStores'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import FilePickerModal from '../../../../src/components/Modals/FilePickerModal.vue'
|
||||
import { defaultComponentMocks, defaultPlugins, shallowMount } from '@ownclouders/web-test-helpers'
|
||||
import { defaultComponentMocks, defaultPlugins, shallowMount } from '../../../../src/testing'
|
||||
import { mock } from 'vitest-mock-extended'
|
||||
import { Resource, SpaceResource } from '@ownclouders/web-client'
|
||||
import { Modal, useModals } from '../../../../src/composables/piniaStores'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import ResourceConflictModal from '../../../../src/components/Modals/ResourceConflictModal.vue'
|
||||
import { defaultComponentMocks, defaultPlugins, shallowMount } from '@ownclouders/web-test-helpers'
|
||||
import { defaultComponentMocks, defaultPlugins, shallowMount } from '../../../../src/testing'
|
||||
import { mock } from 'vitest-mock-extended'
|
||||
import { Resource } from '@ownclouders/web-client'
|
||||
import { ResolveStrategy } from '../../../../src/helpers/resource'
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
defaultPlugins,
|
||||
nextTicks,
|
||||
shallowMount
|
||||
} from '@ownclouders/web-test-helpers'
|
||||
} from '../../../../src/testing'
|
||||
import { mock, mockDeep } from 'vitest-mock-extended'
|
||||
import { Resource, SpaceResource } from '@ownclouders/web-client'
|
||||
import { ListFilesResult } from '@ownclouders/web-client/webdav'
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import NoContentMessage from '../../../src/components/NoContentMessage.vue'
|
||||
import { defaultPlugins, shallowMount } from '@ownclouders/web-test-helpers'
|
||||
|
||||
import { defaultPlugins, shallowMount } from '../../../src/testing'
|
||||
describe('NoContentMessage', () => {
|
||||
describe('icon prop', () => {
|
||||
it('should render the provided icon', () => {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { mock } from 'vitest-mock-extended'
|
||||
import merge from 'lodash-es/merge'
|
||||
import {
|
||||
defaultComponentMocks,
|
||||
defaultPlugins,
|
||||
mount,
|
||||
shallowMount,
|
||||
RouteLocation,
|
||||
RouterLinkStub,
|
||||
defaultComponentMocks,
|
||||
RouteLocation
|
||||
} from '@ownclouders/web-test-helpers'
|
||||
shallowMount
|
||||
} from '../../../src/testing'
|
||||
import Pagination from '../../../src/components/Pagination.vue'
|
||||
|
||||
const filesPersonalRoute = { name: 'files-personal', path: '/files/home' }
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import QuotaSelect from '../../../src/components/QuotaSelect.vue'
|
||||
import { defaultPlugins, shallowMount } from '@ownclouders/web-test-helpers'
|
||||
|
||||
import { defaultPlugins, shallowMount } from '../../../src/testing'
|
||||
describe('QuotaSelect', () => {
|
||||
describe('method "optionSelectable"', () => {
|
||||
it('should return true while option selectable property is not false', () => {
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
defaultPlugins,
|
||||
mount,
|
||||
useGetMatchingSpaceMock
|
||||
} from '@ownclouders/web-test-helpers'
|
||||
} from '../../../../src/testing'
|
||||
import { useFileActions } from '../../../../src/composables/actions'
|
||||
import { CapabilityStore } from '../../../../src/composables/piniaStores'
|
||||
import ResourceListItem from '../../../../src/components/FilesList/ResourceListItem.vue'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useRouteQuery } from '../../../src/composables/router/useRouteQuery'
|
||||
import SearchBarFilter from '../../../src/components/SearchBarFilter.vue'
|
||||
import { defaultComponentMocks, defaultPlugins, shallowMount } from '@ownclouders/web-test-helpers'
|
||||
import { defaultComponentMocks, defaultPlugins, shallowMount } from '../../../src/testing'
|
||||
import { OcFilterChip } from '@ownclouders/design-system/components'
|
||||
import { ref } from 'vue'
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { OcProgress } from '@ownclouders/design-system/components'
|
||||
import { SpaceQuota } from '../../../src/components'
|
||||
import { defaultPlugins, shallowMount } from '@ownclouders/web-test-helpers'
|
||||
import { defaultPlugins, shallowMount } from '../../../src/testing'
|
||||
import { Quota } from '@ownclouders/web-client/graph/generated'
|
||||
|
||||
describe('SpaceQuota component', () => {
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
import QuotaModal from '../../../../src/components/Spaces/QuotaModal.vue'
|
||||
import {
|
||||
defaultComponentMocks,
|
||||
defaultPlugins,
|
||||
defaultStubs,
|
||||
mount
|
||||
} from '@ownclouders/web-test-helpers'
|
||||
import { defaultComponentMocks, defaultPlugins, defaultStubs, mount } from '../../../../src/testing'
|
||||
import { useMessages, useSpacesStore } from '../../../../src/composables/piniaStores'
|
||||
import { SpaceResource } from '@ownclouders/web-client'
|
||||
import { mock } from 'vitest-mock-extended'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { defineComponent, nextTick } from 'vue'
|
||||
import { defaultPlugins, mount } from '@ownclouders/web-test-helpers'
|
||||
import { defaultPlugins, mount } from '../../../../src/testing'
|
||||
import { flushPromises } from '@vue/test-utils'
|
||||
import { config } from 'md-editor-v3'
|
||||
import { useMessages } from '../../../../src/composables'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { flushPromises } from '@vue/test-utils'
|
||||
import { nextTick } from 'vue'
|
||||
import { defaultPlugins, mount } from '@ownclouders/web-test-helpers'
|
||||
import { defaultPlugins, mount } from '../../../../src/testing'
|
||||
import TextEditor from '../../../../src/components/TextEditor/TextEditor.vue'
|
||||
|
||||
// Mounts the real md-editor-v3 rather than the stub used by TextEditor.spec.ts: the `footers`
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { ref, unref } from 'vue'
|
||||
import {
|
||||
defaultPlugins,
|
||||
defaultComponentMocks,
|
||||
defaultPlugins,
|
||||
mount,
|
||||
RouteLocation,
|
||||
PartialComponentProps
|
||||
} from '@ownclouders/web-test-helpers'
|
||||
PartialComponentProps,
|
||||
RouteLocation
|
||||
} from '../../../src/testing'
|
||||
import { mock } from 'vitest-mock-extended'
|
||||
import ViewOptions from '../../../src/components/ViewOptions.vue'
|
||||
import {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import CompareSaveDialog from '../../../../src/components/SideBar/CompareSaveDialog.vue'
|
||||
import { defaultPlugins, shallowMount } from '@ownclouders/web-test-helpers'
|
||||
|
||||
import { defaultPlugins, shallowMount } from '../../../../src/testing'
|
||||
describe('CompareSaveDialog', () => {
|
||||
describe('computed method "unsavedChanges"', () => {
|
||||
it('should be false if objects are equal', () => {
|
||||
|
||||
Loaded 100 of 195 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user