The frontend for the project formerly known as signet, now known as beignet.
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

36 lines
995 B

  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. });