The frontend for the project formerly known as signet, now known as beignet.
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 

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