The frontend for the project formerly known as signet, now known as beignet.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

example.spec.ts 995 B

pirms 2 gadiem
pirms 2 gadiem
pirms 2 gadiem
pirms 2 gadiem
pirms 2 gadiem
1234567891011121314151617181920212223242526272829303132333435
  1. import { shallowMount } from '@vue/test-utils';
  2. import {
  3. createRouter,
  4. createWebHistory,
  5. } from 'vue-router';
  6. import signetRouter from '@/router';
  7. import FundLink from '@/components/FundLink.vue';
  8. import { expect } from 'chai';
  9. const router = createRouter({
  10. history: createWebHistory(),
  11. routes: signetRouter.getRoutes(),
  12. });
  13. describe('router', () => {
  14. it('requires permissions before routing', async () => {
  15. await router.push('/admin/modifyuser');
  16. const admin = router.options.routes.find((r) => r.path === '/admin');
  17. const permissionsOnAllAdmin = admin && admin.children && admin.children.length > 0
  18. && admin.children.every((r) => r.meta && r.meta.requiredRights);
  19. expect(permissionsOnAllAdmin);
  20. });
  21. });
  22. describe('FundLink.vue', () => {
  23. it('renders props.msg when passed', () => {
  24. const msg = 'new message';
  25. const wrapper = shallowMount(FundLink, {
  26. props: { msg },
  27. });
  28. expect(wrapper.text())
  29. .to
  30. .include(msg);
  31. });
  32. });