diff --git a/.env.example b/.env.example new file mode 100644 index 0000000000000000000000000000000000000000..9ed5145b1a8f93b1049dcd4813f889b74c1a63e1 --- /dev/null +++ b/.env.example @@ -0,0 +1,3 @@ +NEXT_PUBLIC_API_URL=http://localhost:3051/ + +NEXTAUTH_SECRET=1010FFF #Coloque a mesma coisa que está no back-end \ No newline at end of file diff --git a/.env.exemple b/.env.exemple deleted file mode 100644 index 9519b0b126ce2cb208dfa48fab29b20ee0e77779..0000000000000000000000000000000000000000 --- a/.env.exemple +++ /dev/null @@ -1,142 +0,0 @@ -# NEXT_PUBLIC_API_URL=http://localhost:3051/ - -NEXT_PUBLIC_ALUNO_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7Il9pZCI6M30sImlhdCI6MTczNDQ4NTkzNSwiZXhwIjoxNzQ3NDQ1OTM1fQ.XKFtQJxcxvaG61ds1D9nuvgpWizvkCdd5pWn4isOEh8 -NEXT_PUBLIC_ALUNO_NOME=Aluno Leando -NEXT_PUBLIC_ALUNO_ID=3 -NEXT_PUBLIC_ALUNO_MATRICULA=1122334455 -NEXT_PUBLIC_ALUNO_PERMISSOES='[ - { - "id": 1, - "rota": "aula", - "get": true, - "post": false, - "patch": false, - "put": false, - "delete": false - }, - { - "id": 2, - "rota": "modulo", - "get": true, - "post": false, - "patch": false, - "put": false, - "delete": false - }, - { - "id": 3, - "rota": "turma", - "get": true, - "post": false, - "patch": false, - "put": false, - "delete": false - }, - { - "id": 4, - "rota": "usuario", - "get": true, - "post": false, - "patch": false, - "put": false, - "delete": false - }, - { - "id": 5, - "rota": "aula/status", - "get": true, - "post": true, - "patch": false, - "put": false, - "delete": false - } - ]' - - -NEXT_PUBLIC_PROFESSOR_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7Il9pZCI6Mn0sImlhdCI6MTczNDQ4NjI2MSwiZXhwIjoxNzQ3NDQ2MjYxfQ.R71ByTnt_3UbuPCnmHTM1Esxmd5cLDQk7cS9Zle8RQY -NEXT_PUBLIC_PROFESSOR_NOME=Professor Marco -NEXT_PUBLIC_PROFESSOR_ID=2 -NEXT_PUBLIC_PROFESSOR_MATRICULA=1020304050 -NEXT_PUBLIC_PROFESSOR_PERMISSOES='[ - { - "id": 5, - "rota": "aula/status", - "get": true, - "post": false, - "patch": false, - "put": false, - "delete": false - }, - { - "id": 6, - "rota": "usuario/csv", - "get": false, - "post": true, - "patch": false, - "put": false, - "delete": false - }, - { - "id": 7, - "rota": "aula", - "get": true, - "post": true, - "patch": true, - "put": true, - "delete": true - }, - { - "id": 8, - "rota": "modulo", - "get": true, - "post": true, - "patch": true, - "put": true, - "delete": true - }, - { - "id": 9, - "rota": "turma", - "get": true, - "post": true, - "patch": true, - "put": true, - "delete": true - }, - { - "id": 10, - "rota": "usuario", - "get": true, - "post": true, - "patch": true, - "put": true, - "delete": true - }, - { - "id": 11, - "rota": "arquivos", - "get": true, - "post": true, - "patch": true, - "put": true, - "delete": true - }, - { - "id": 12, - "rota": "arquivos/*", - "get": true, - "post": true, - "patch": true, - "put": true, - "delete": true - }, - { - "id": 13, - "rota": "arquivos:id", - "get": true, - "post": true, - "patch": true, - "put": true, - "delete": true - } - ]' diff --git a/auth.js b/auth.js index c3d12e719d165e2f739a49db1ca954be999c5e9a..eb41170237431dd3b33e96c2750b5657fd79d306 100644 --- a/auth.js +++ b/auth.js @@ -1,75 +1,53 @@ import { createCookie } from "@/actions/handleCookie.js"; import NextAuth from "next-auth"; import Credentials from "next-auth/providers/credentials"; -import { fetchApiLogin } from "./src/utils/fetchApiLogin"; // Import fetchApi +import { fetchApiLogin } from "./src/utils/fetchApiLogin"; export const { handlers, signIn, signOut, auth } = NextAuth({ providers: [ Credentials({ credentials: { - matricula: { label: "Matricula", type: "text" }, - senha: { label: "Senha", type: "password" }, + matricula: {}, + senha: {}, }, authorize: async (credentials) => { console.log("Credenciais do front:", credentials); + let route = process.env.NEXT_PUBLIC_API_URL; + let data = await fetchApiLogin(route + "login", "POST", { + matricula: credentials.matricula, + senha: credentials.senha, + }); + console.log("Resposta da API:", data); - try { - let route = process.env.NEXT_PUBLIC_API_URL; - let data = await fetchApiLogin(route + "login", "POST", { - matricula: credentials.matricula, - senha: credentials.senha, - }); - - console.log("Resposta da API:", data); - - if (!data.error && data.data && data.data.usuario) { - const { access_token, refresh_token, usuario, permissoes } = data.data; - await createCookie("access_token", access_token); - await createCookie("refresh_token", refresh_token); - await createCookie("PermissoesUser", JSON.stringify(permissoes)); - await createCookie("nome", usuario.nome); - console.log("Nome do usuário:", usuario.nome); - await createCookie("matricula", usuario.matricula); - - return { - id: usuario.id.toString(), - nome: usuario.nome, - matricula: usuario.matricula, - grupo_id: usuario.grupo_id, - active: usuario.active, - access_token, - }; - } else { - console.error("Erro na autenticação:", data.error); - return null; - } - } catch (error) { - console.error("Erro ao processar a autenticação:", error); - return null; + if (!data.error && data.data && data.data.usuario) { + const { access_token, usuario, permissoes } = data.data; + await createCookie("access_token", access_token); + await createCookie("nome", usuario.nome); + await createCookie("matricula", usuario.matricula); + return { + id: usuario.id.toString(), + nome: usuario.nome, + matricula: usuario.matricula, + grupo_id: usuario.grupo_id, + active: usuario.active, + access_token, + permissoes + }; } + return null; }, }), ], callbacks: { + async session({ session, token }) { + session.user = token.user; + return session; + }, async jwt({ token, user }) { if (user) { - token.id = user.id; - token.nome = user.nome; - token.matricula = user.matricula; - token.grupo_id = user.grupo_id; - token.active = user.active; - token.access_token = user.access_token; + token.user = user; } return token; }, - async session({ session, token }) { - session.user.id = token.id; - session.user.nome = token.nome; - session.user.matricula = token.matricula; - session.user.grupo_id = token.grupo_id; - session.user.active = token.active; - session.access_token = token.access_token; - return session; - }, }, }); \ No newline at end of file diff --git a/cypress/e2e/3-tela-gerenciamento/formAtualizarAula.cy.js b/cypress/e2e/3-tela-gerenciamento/formAtualizarAula.cy.js index 086e4a144edafc0636ecc7430c29520198a2dedc..8f081a3910a596273bba97658964e5ebaf83d58f 100644 --- a/cypress/e2e/3-tela-gerenciamento/formAtualizarAula.cy.js +++ b/cypress/e2e/3-tela-gerenciamento/formAtualizarAula.cy.js @@ -1,105 +1,105 @@ describe('Testando a atualização de aula.', () => { - it('Acessando o módulo e atualizando a aula 25 duas vezes. caminho feliz.', () => { - cy.visit('http://localhost:3000/modulos/gerenciar') + it('Acessando o módulo e atualizando a aula 25 duas vezes. caminho feliz.', () => { + cy.visit('http://localhost:3000/modulos/gerenciar') - cy.intercept('PATCH', 'http://localhost:3051/aula/25').as('patchRequest'); + cy.intercept('PATCH', 'http://localhost:3051/aula/25').as('patchRequest'); - cy.getByData("filtrarAno").should('exist') - cy.getByData("filtrarAno").click() - cy.get('[data-test="1º Ano"]').should('exist') - cy.get('[data-test="1º Ano"]').click() + cy.getByData("filtrarAno").should('exist') + cy.getByData("filtrarAno").click() + cy.get('[data-test="1º Ano"]').should('exist') + cy.get('[data-test="1º Ano"]').click() - cy.getByData("filtrarModulo").should('exist') - cy.getByData("filtrarModulo").click() - cy.get('[data-test="Introdução à Aritmética"]').should('exist') - cy.get('[data-test="Introdução à Aritmética"]').click() + cy.getByData("filtrarModulo").should('exist') + cy.getByData("filtrarModulo").click() + cy.get('[data-test="Introdução à Aritmética"]').should('exist') + cy.get('[data-test="Introdução à Aritmética"]').click() - // valida de o modal foi carregado - cy.getByData("atualizar-aula-25").click() + // valida de o modal foi carregado + cy.getByData("atualizar-aula-25").click() - cy.getByData("inputTitulo").should("exist") - cy.getByData("inputDescricao").should("exist") - cy.getByData("inputUrl").should("exist") - cy.getByData("buttonAtzAula").should("exist") + cy.getByData("inputTitulo").should("exist") + cy.getByData("inputDescricao").should("exist") + cy.getByData("inputUrl").should("exist") + cy.getByData("buttonAtzAula").should("exist") - // atualiza um módulo - cy.getByData("inputTitulo").clear().type("Aula atualizada") - cy.getByData("inputDescricao").clear().type("descrição da aula atualizada") - cy.getByData("inputUrl").clear().type("https://www.youtube.com/watch?v=ralJmHG-DII") + // atualiza um módulo + cy.getByData("inputTitulo").clear().type("Aula atualizada") + cy.getByData("inputDescricao").clear().type("descrição da aula atualizada") + cy.getByData("inputUrl").clear().type("https://www.youtube.com/watch?v=ralJmHG-DII") - cy.getByData("buttonAtzAula").click() + cy.getByData("buttonAtzAula").click() - // valida se o tÃtulo da aula foi atualizado na tela - cy.getByData("titulo-aula-25").should('exist').and('have.text', 'Aula atualizada') + // valida se o tÃtulo da aula foi atualizado na tela + cy.getByData("titulo-aula-25").should('exist').and('have.text', 'Aula atualizada') - //valida se a requisição foi bem sucedida - cy.wait('@patchRequest').then((interception) => { - expect(interception.response.statusCode).to.eq(200); + //valida se a requisição foi bem sucedida + cy.wait('@patchRequest').then((interception) => { + expect(interception.response.statusCode).to.eq(200); - expect(interception.response.body).to.have.property('error', false); - }); + expect(interception.response.body).to.have.property('error', false); + }); - //atualiza o módulo novamente com o titulo original - cy.getByData("atualizar-aula-25").click() + //atualiza o módulo novamente com o titulo original + cy.getByData("atualizar-aula-25").click() - cy.getByData("inputTitulo").clear().type("Introdução à Ãlgebra: Conceitos Básicos") - cy.getByData("inputDescricao").clear().type("Nesta aula, abordaremos os conceitos iniciais fundamentais da álgebra, uma das áreas mais importantes da matemática. A álgebra lida com sÃmbolos e as regras para manipulação desses sÃmbolos, permitindo resolver uma ampla gama de problemas matemáticos.") - cy.getByData("inputUrl").clear().type("https://www.youtube.com/watch?v=ralJmHG-DII") + cy.getByData("inputTitulo").clear().type("Introdução à Ãlgebra: Conceitos Básicos") + cy.getByData("inputDescricao").clear().type("Nesta aula, abordaremos os conceitos iniciais fundamentais da álgebra, uma das áreas mais importantes da matemática. A álgebra lida com sÃmbolos e as regras para manipulação desses sÃmbolos, permitindo resolver uma ampla gama de problemas matemáticos.") + cy.getByData("inputUrl").clear().type("https://www.youtube.com/watch?v=ralJmHG-DII") - cy.getByData("buttonAtzAula").click() + cy.getByData("buttonAtzAula").click() - //valida se a requisição foi bem sucedida - cy.wait('@patchRequest').then((interception) => { - expect(interception.response.statusCode).to.eq(200); + //valida se a requisição foi bem sucedida + cy.wait('@patchRequest').then((interception) => { + expect(interception.response.statusCode).to.eq(200); - expect(interception.response.body).to.have.property('error', false); - }); + expect(interception.response.body).to.have.property('error', false); + }); - // valida se o tÃtulo da aula foi atualizado na tela - cy.getByData("titulo-aula-25").should('exist').and('have.text', 'Introdução à Ãlgebra: Conceitos Básicos') - }) + // valida se o tÃtulo da aula foi atualizado na tela + cy.getByData("titulo-aula-25").should('exist').and('have.text', 'Introdução à Ãlgebra: Conceitos Básicos') + }) }) describe('Testando a atualização de aula. (CAMINHO TRISTE)', () => { - it('tentando atualizar uma aula sem passar os paramentros.', () => { - cy.visit('http://localhost:3000/modulos/gerenciar') + it('tentando atualizar uma aula sem passar os paramentros.', () => { + cy.visit('http://localhost:3000/modulos/gerenciar') - cy.intercept('PATCH', 'http://localhost:3051/aula/25').as('patchRequest'); + cy.intercept('PATCH', 'http://localhost:3051/aula/25').as('patchRequest'); - cy.getByData("filtrarAno").should('exist') - cy.getByData("filtrarAno").click() - cy.get('[data-test="1º Ano"]').should('exist') - cy.get('[data-test="1º Ano"]').click() + cy.getByData("filtrarAno").should('exist') + cy.getByData("filtrarAno").click() + cy.get('[data-test="1º Ano"]').should('exist') + cy.get('[data-test="1º Ano"]').click() - cy.getByData("filtrarModulo").should('exist') - cy.getByData("filtrarModulo").click() - cy.get('[data-test="Introdução à Aritmética"]').should('exist') - cy.get('[data-test="Introdução à Aritmética"]').click() + cy.getByData("filtrarModulo").should('exist') + cy.getByData("filtrarModulo").click() + cy.get('[data-test="Introdução à Aritmética"]').should('exist') + cy.get('[data-test="Introdução à Aritmética"]').click() - // valida de o modal foi carregado - cy.getByData("atualizar-aula-25").click() + // valida de o modal foi carregado + cy.getByData("atualizar-aula-25").click() - cy.getByData("inputTitulo").should("exist") - cy.getByData("inputDescricao").should("exist") - cy.getByData("inputUrl").should("exist") - cy.getByData("buttonAtzAula").should("exist") + cy.getByData("inputTitulo").should("exist") + cy.getByData("inputDescricao").should("exist") + cy.getByData("inputUrl").should("exist") + cy.getByData("buttonAtzAula").should("exist") - // deixa os imputs vazios - cy.getByData("inputTitulo").clear() - cy.getByData("inputDescricao").clear() - cy.getByData("inputUrl").clear() + // deixa os imputs vazios + cy.getByData("inputTitulo").clear() + cy.getByData("inputDescricao").clear() + cy.getByData("inputUrl").clear() - cy.getByData("buttonAtzAula").click() + cy.getByData("buttonAtzAula").click() - // valida se as mensagens de erro aparecem na tela - cy.getByData("errorTitulo").should('exist').and('have.text', 'TÃtulo é obrigatório.') - cy.getByData("errorDescricao").should('exist').and('have.text', 'A Descrição é obrigatória.') - cy.getByData("errorUrl").should('exist').and('have.text', 'O vÃdeo é obrigatório.') + // valida se as mensagens de erro aparecem na tela + cy.getByData("errorTitulo").should('exist').and('have.text', 'TÃtulo é obrigatório.') + cy.getByData("errorDescricao").should('exist').and('have.text', 'A Descrição é obrigatória.') + cy.getByData("errorUrl").should('exist').and('have.text', 'O vÃdeo é obrigatório.') - }) + }) }) diff --git a/cypress/e2e/4-tela-cadastrar-modulos/adetrando-na-tela.cy.js b/cypress/e2e/4-tela-cadastrar-modulos/adetrando-na-tela.cy.js deleted file mode 100644 index 453db2e2fe8554b3325864ded8a5bd578e716621..0000000000000000000000000000000000000000 --- a/cypress/e2e/4-tela-cadastrar-modulos/adetrando-na-tela.cy.js +++ /dev/null @@ -1,51 +0,0 @@ -describe('Testando os caminhos felizes.', () => { - it('Realizando login com um usuário valido.', () => { - - cy.intercept('POST', 'http://localhost:3051/login').as('postRequest'); - - cy.visit('http://localhost:3000/login')//Acessando a página de login com o localhost e a porta 3000, mas o normal é que seja feito na porta 3000 - - cy.getByData('inputMatricula').type('123456') - cy.getByData('inputSenha').type('senhatest') - cy.getByData('form-submit').click() - - cy.wait('@postRequest').then((interception) => { - expect(interception.response.statusCode).to.eq(200); - - expect(interception.response.body).to.have.property('error', false); - }); - - cy.url().should('include', '/modulos') - - cy.getByData('criarModulo').should('exist').click(); - }); - - it('Verificando existência dos componentes da tela de cadastrar módulos.', () => { - cy.visit('http://localhost:3000/modulos/cadastrar'); - - cy.get('[data-test="spin-green-loding"]').should('exist'); - - cy.get('[data-test="nav-menu"]').within(() => { - cy.get('li').first().find('img') - cy.get('li').last().find('a').should('contain', 'Criando Módulo') - .and('have.class', 'border-b-4') - .and('have.class', 'border-verde'); - }); - - cy.get('[data-test="input-titulo"]').should('exist'); - cy.get('[data-test="input-descricao"]').should('exist'); - cy.get('[data-test="input-imagem"]').should('exist'); - cy.get('[data-test="select-turma-id"]').should('exist').click(); - cy.get('[data-test="select-item-1"]').should('exist'); - cy.get('[data-test="select-item-2"]').should('exist'); - cy.get('[data-test="select-item-3"]').should('exist'); - cy.get('[data-test="select-item-4"]').should('exist'); - cy.get('[data-test="btn-criar-modulo"]').should('exist'); - - cy.get('[data-test="card-criar-modulo"]').within(() => { - cy.get('h3').should('contain', 'TÃtulo do Módulo'); - cy.get('p').should('contain', 'Descrição do módulo.'); - cy.get('img').should('have.attr', 'src').should('include', '/random_people.jpg'); - }); - }); -}); diff --git a/cypress/e2e/4-tela-cadastrar-modulos/cadastrando-modulo.cy.js b/cypress/e2e/4-tela-cadastrar-modulos/cadastrando-modulo.cy.js deleted file mode 100644 index 71d6458cdd81bf2efc84a17f40d6c0be5153c5cd..0000000000000000000000000000000000000000 --- a/cypress/e2e/4-tela-cadastrar-modulos/cadastrando-modulo.cy.js +++ /dev/null @@ -1,136 +0,0 @@ -describe('Testando o caminho felize.', () => { - it('Realizando login com um usuário valido.', () => { - - cy.intercept('POST', 'http://localhost:3051/login').as('postRequest'); - - cy.visit('http://localhost:3000/login')//Acessando a página de login com o localhost e a porta 3001, mas o normal é que seja feito na porta 3000 - - cy.getByData('inputMatricula').type('123456') - cy.getByData('inputSenha').type('senhatest') - cy.getByData('form-submit').click() - - cy.wait('@postRequest').then((interception) => { - expect(interception.response.statusCode).to.eq(200); - - expect(interception.response.body).to.have.property('error', false); - }); - - cy.url().should('include', '/modulos') - - cy.getByData('criarModulo').should('exist').click(); - }); - - it('Verificando existência dos componentes da tela de cadastrar módulos.', () => { - cy.visit('http://localhost:3000/modulos/cadastrar'); - - cy.get('[data-test="input-titulo"]').should('exist').type('Fazendo o teste do cypress'); - cy.get('[data-test="card-criar-modulo"]').within(() => { - cy.get('h3').should('contain', 'Fazendo o teste do cypress'); - }); - - cy.get('[data-test="input-descricao"]').should('exist').type('Sombras dançam em labirintos etéreos...'); - cy.get('[data-test="card-criar-modulo"]').within(() => { - cy.get('p').should('contain', 'Sombras dançam em labirintos etéreos...'); - }); - - cy.get('[data-test="input-imagem"]').should('exist').selectFile('cypress/fixtures/random.png', {force: true}); - cy.get('[data-test="card-criar-modulo"]').within(() => { - cy.get('img').should('have.attr', 'src').and('include', 'blob:'); - }); - - cy.get('[data-test="select-turma-id"]').should('exist').click(); - cy.get('[data-test="select-item-1"]').should('exist').click(); - cy.get('[data-test="btn-criar-modulo"]').should('exist');//.click(); - }); - - //Fazer o teste de quando o card de mensagem de envio aparecer e verificar se o módulo foi cadastrado indo na tela de módulos -}); - -describe('Testando o caminho infeliz.', () => { - it('Deve retornar um erro ao tentar cadastrar um módulo sem preencher os campos.', () => { - cy.visit('http://localhost:3000/modulos/cadastrar'); - - cy.get('[data-test="btn-criar-modulo"]').should('exist').click(); - - cy.get('[data-test="msg-erro-titulo-cadastrar-modulo"]').should('contain', 'TÃtulo é obrigatório.'); - cy.get('[data-test="msg-erro-descricao-cadastrar-modulo"]').should('contain', 'Descrição é obrigatória.'); - cy.get('[data-test="msg-erro-imagem-cadastrar-modulo"]').should('contain', 'Selecione uma imagem.'); - cy.get('[data-test="msg-erro-turma-cadastrar-modulo"]').should('contain', 'Você precisa selecionar uma turma.'); - }); - - it('Deve retornar um erro ao tentar cadastrar um módulo sem preencher o tÃtulo.', () => { - cy.visit('http://localhost:3000/modulos/cadastrar'); - - cy.get('[data-test="input-descricao"]').should('exist').type('Sombras dançam em labirintos etéreos...'); - cy.get('[data-test="card-criar-modulo"]').within(() => { - cy.get('p').should('contain', 'Sombras dançam em labirintos etéreos...'); - }); - cy.get('[data-test="input-imagem"]').should('exist').selectFile('cypress/fixtures/random.png', {force: true}); - cy.get('[data-test="card-criar-modulo"]').within(() => { - cy.get('img').should('have.attr', 'src').and('include', 'blob:'); - }); - cy.get('[data-test="select-turma-id"]').should('exist').click(); - cy.get('[data-test="select-item-1"]').should('exist').click(); - - cy.get('[data-test="btn-criar-modulo"]').should('exist').click(); - cy.get('[data-test="msg-erro-titulo-cadastrar-modulo"]').should('contain', 'TÃtulo é obrigatório.'); - }); - - it('Deve retornar um erro ao tentar cadastrar um módulo sem preencher a descrição.', () => { - cy.visit('http://localhost:3000/modulos/cadastrar'); - - cy.get('[data-test="input-titulo"]').should('exist').type('Fazendo o teste do cypress'); - cy.get('[data-test="card-criar-modulo"]').within(() => { - cy.get('h3').should('contain', 'Fazendo o teste do cypress'); - }); - cy.get('[data-test="input-imagem"]').should('exist').selectFile('cypress/fixtures/random.png', {force: true}); - cy.get('[data-test="card-criar-modulo"]').within(() => { - cy.get('img').should('have.attr', 'src').and('include', 'blob:'); - }); - cy.get('[data-test="select-turma-id"]').should('exist').click(); - cy.get('[data-test="select-item-1"]').should('exist').click(); - - cy.get('[data-test="btn-criar-modulo"]').should('exist').click(); - cy.get('[data-test="msg-erro-descricao-cadastrar-modulo"]').should('contain', 'Descrição é obrigatória.'); - }); - - it('Deve retornar um erro ao tentar cadastrar um módulo sem preencher a imagem.', () => { - cy.visit('http://localhost:3000/modulos/cadastrar'); - - cy.get('[data-test="input-titulo"]').should('exist').type('Fazendo o teste do cypress'); - cy.get('[data-test="card-criar-modulo"]').within(() => { - cy.get('h3').should('contain', 'Fazendo o teste do cypress'); - }); - cy.get('[data-test="input-descricao"]').should('exist').type('Sombras dançam em labirintos etéreos...'); - cy.get('[data-test="card-criar-modulo"]').within(() => { - cy.get('p').should('contain', 'Sombras dançam em labirintos etéreos...'); - }); - cy.get('[data-test="select-turma-id"]').should('exist').click(); - cy.get('[data-test="select-item-1"]').should('exist').click(); - - cy.get('[data-test="btn-criar-modulo"]').should('exist').click(); - cy.get('[data-test="msg-erro-imagem-cadastrar-modulo"]').should('contain', 'Selecione uma imagem.'); - }); - - it('Deve retornar um erro ao tentar cadastrar um módulo sem preencher a turma.', () => { - cy.visit('http://localhost:3000/modulos/cadastrar'); - - cy.get('[data-test="input-titulo"]').should('exist').type('Fazendo o teste do cypress'); - cy.get('[data-test="card-criar-modulo"]').within(() => { - cy.get('h3').should('contain', 'Fazendo o teste do cypress'); - }); - cy.get('[data-test="input-descricao"]').should('exist').type('Sombras dançam em labirintos etéreos...'); - cy.get('[data-test="card-criar-modulo"]').within(() => { - cy.get('p').should('contain', 'Sombras dançam em labirintos etéreos...'); - }); - cy.get('[data-test="input-imagem"]').should('exist').selectFile('cypress/fixtures/random.png', {force: true}); - cy.get('[data-test="card-criar-modulo"]').within(() => { - cy.get('img').should('have.attr', 'src').and('include', 'blob:'); - }); - - cy.get('[data-test="btn-criar-modulo"]').should('exist').click(); - cy.get('[data-test="msg-erro-turma-cadastrar-modulo"]').should('contain', 'Você precisa selecionar uma turma.'); - }); - - //Fazer o erro de quando o card de mensagem de envio não aparecer -}); \ No newline at end of file diff --git a/cypress/e2e/4-tela-modulos/cadastrar/TESTEAPENAS.cy.js b/cypress/e2e/4-tela-modulos/cadastrar/TESTEAPENAS.cy.js new file mode 100644 index 0000000000000000000000000000000000000000..ec579a5a2c5ea639b29055563e7f6b369d8c6437 --- /dev/null +++ b/cypress/e2e/4-tela-modulos/cadastrar/TESTEAPENAS.cy.js @@ -0,0 +1,51 @@ +let urlPORT3002 = 'http://localhost:3002'; +let urlPORT3000 = 'http://localhost:3000'; + +describe('Testando os caminhos felizes.', () => { + let authToken; + + let resultadotitulo; + let resultadoDescricao; + let resultadoImagem; + + beforeEach('Realizando login com um usuário valido.', () => { + cy.viewport(1920, 1080); + cy.request({ + method: 'POST', + url: 'http://localhost:3051/login', + headers: { + 'Content-Type': 'application/json', + }, + body: { + matricula: "123456", + senha: "senhatest" + } + }).then((response) => { + authToken = response.body.data.access_token; + expect(authToken).is.not.null; + }); + }); + it("Deve obter a lista o estoque do almoxarifado", () => { + // Realiza a requisição GET para a rota '/transacoes' usando o token de autenticação + cy.request({ + method: 'GET', + url: 'http://localhost:3051/modulo', + headers: { + 'Authorization': `Bearer ${authToken}`, // Usar o token obtido no login + }, + }).then((response) => { + // Valida se a resposta não é nula e contém dados + expect(response.body.data).to.not.be.null; + expect(response.body.data).to.be.an('array').that.is.not.empty; // Verifica se é um array e não está vazio + + // Armazena os dados do primeiro usuario para uso posterior + resultadotitulo = response.body.data[0].titulo; + resultadoDescricao = response.body.data[0].descricao; + resultadoImagem = response.body.data[0].image; + + console.log("Titulo", resultadotitulo); + console.log("Descricao", resultadoDescricao); + console.log("Imagem", resultadoImagem); + }); + }); +}); diff --git a/cypress/e2e/4-tela-modulos/cadastrar/adetrando-na-tela.cy.js b/cypress/e2e/4-tela-modulos/cadastrar/adetrando-na-tela.cy.js new file mode 100644 index 0000000000000000000000000000000000000000..057c59dd7d74ec947ca08bbfe156808d3220d81b --- /dev/null +++ b/cypress/e2e/4-tela-modulos/cadastrar/adetrando-na-tela.cy.js @@ -0,0 +1,46 @@ +let urlPORT3002 = 'http://localhost:3002'; +let urlPORT3000 = 'http://localhost:3000'; + +describe('Entrando na tela.', () => { + beforeEach('Realizando login com um usuário valido.', () => { + cy.viewport(1920, 1080); + //Login no front-end + cy.visit(urlPORT3000 + "/login") + + cy.login('123456', 'senhatest') + + // Verificando se o usuário acessou a tela de modulos. + cy.url().should('include', '/modulos') + + cy.getByData('criarModulo').should('exist').click(); + }); + + it('Verificando existência dos componentes da tela de cadastrar módulos.', () => { + cy.visit(urlPORT3000 + "/modulos/cadastrar"); + + cy.getByData('spin-green-loding').should('exist'); + + cy.getByData('nav-menu').within(() => { + cy.get('li').first().find('img') + cy.get('li').last().find('a').should('contain', 'Criando Módulo') + .and('have.class', 'border-b-4') + .and('have.class', 'border-verde'); + }); + + cy.getByData("input-titulo").should('exist'); + cy.getByData('input-descricao').should('exist'); + cy.getByData('input-imagem').should('exist'); + cy.getByData('select-turma-id').should('exist').click(); + cy.getByData('select-item-1').should('exist'); + cy.getByData('select-item-2').should('exist'); + cy.getByData('select-item-3').should('exist'); + cy.getByData('select-item-4').should('exist'); + cy.getByData('btn-criar-modulo').should('exist'); + + cy.getByData('card-criar-modulo').within(() => { + cy.get('h3').should('contain', 'TÃtulo do Módulo'); + cy.get('p').should('contain', 'Descrição do módulo.'); + cy.get('img').should('have.attr', 'src').should('include', '/random_people.jpg'); + }); + }); +}); diff --git a/cypress/e2e/4-tela-modulos/cadastrar/cadastrando-modulo.cy.js b/cypress/e2e/4-tela-modulos/cadastrar/cadastrando-modulo.cy.js new file mode 100644 index 0000000000000000000000000000000000000000..59e6ea336c980ce52fe0d12942860fc24661b8e1 --- /dev/null +++ b/cypress/e2e/4-tela-modulos/cadastrar/cadastrando-modulo.cy.js @@ -0,0 +1,133 @@ +let urlPORT3002 = 'http://localhost:3002'; +let urlPORT3000 = 'http://localhost:3000'; + +describe('Testando a tela de cadastrar módulos.', () => { + beforeEach('Realizando login com um usuário válido.', () => { + cy.viewport(1920, 1080); + //Login no front-end + cy.visit(urlPORT3000 + "/login") + + cy.login('123456', 'senhatest') + + // Verificando se o usuário acessou a tela de modulos. + cy.url().should('include', '/modulos') + + cy.getByData('criarModulo').should('exist').click(); + }); + describe('Caminho feliz.', () => { + + it('Cadastrando módulos.', () => { + cy.visit(urlPORT3000 + "/modulos/cadastrar"); + + cy.getByData('input-titulo').should('exist').type('Fazendo o teste do cypress'); + cy.getByData('card-criar-modulo').within(() => { + cy.get('h3').should('contain', 'Fazendo o teste do cypress'); + }); + + cy.getByData('input-descricao').should('exist').type('Sombras dançam em labirintos etéreos...'); + cy.getByData('card-criar-modulo').within(() => { + cy.get('p').should('contain', 'Sombras dançam em labirintos etéreos...'); + }); + + cy.getByData('input-imagem').should('exist').selectFile('cypress/fixtures/random.png', { force: true }); + cy.getByData('card-criar-modulo').within(() => { + cy.get('img').should('have.attr', 'src').and('include', 'blob:'); + }); + + cy.getByData('select-turma-id').should('exist').click(); + cy.getByData('select-item-1').should('exist').click(); + cy.getByData('btn-criar-modulo').should('exist').click(); + cy.getByData('toast-sucesso-criar-modulo').should('contain', 'Módulo criado com sucesso.'); + }); + }); + + describe('Testando o caminho infeliz.', () => { + + it('Deve retornar um erro ao tentar cadastrar um módulo sem preencher os campos.', () => { + cy.visit(urlPORT3000 + "/modulos/cadastrar"); + + cy.getByData('btn-criar-modulo').should('exist').click(); + + cy.getByData('msg-erro-titulo-cadastrar-modulo').should('contain', 'TÃtulo é obrigatório.'); + cy.getByData('msg-erro-descricao-cadastrar-modulo').should('contain', 'Descrição é obrigatória.'); + cy.getByData('msg-erro-imagem-cadastrar-modulo').should('contain', 'Selecione uma imagem.'); + cy.getByData('msg-erro-turma-cadastrar-modulo').should('contain', 'Você precisa selecionar uma turma.'); + }); + + it('Deve retornar um erro ao tentar cadastrar um módulo sem preencher o tÃtulo.', () => { + cy.visit(urlPORT3000 + "/modulos/cadastrar"); + + cy.getByData('input-descricao').should('exist').type('Sombras dançam em labirintos etéreos...'); + cy.getByData('card-criar-modulo').within(() => { + cy.get('p').should('contain', 'Sombras dançam em labirintos etéreos...'); + }); + cy.getByData('input-imagem').should('exist').selectFile('cypress/fixtures/random.png', { force: true }); + cy.getByData('card-criar-modulo').within(() => { + cy.get('img').should('have.attr', 'src').and('include', 'blob:'); + }); + cy.getByData('select-turma-id').should('exist').click(); + cy.getByData('select-item-1').should('exist').click(); + + cy.getByData('btn-criar-modulo').should('exist').click(); + cy.getByData('msg-erro-titulo-cadastrar-modulo').should('contain', 'TÃtulo é obrigatório.'); + }); + + it('Deve retornar um erro ao tentar cadastrar um módulo sem preencher a descrição.', () => { + cy.visit(urlPORT3000 + "/modulos/cadastrar"); + + cy.getByData('input-titulo').should('exist').type('Fazendo o teste do cypress'); + cy.getByData('card-criar-modulo').within(() => { + cy.get('h3').should('contain', 'Fazendo o teste do cypress'); + }); + cy.getByData('input-imagem').should('exist').selectFile('cypress/fixtures/random.png', { force: true }); + cy.getByData('card-criar-modulo').within(() => { + cy.get('img').should('have.attr', 'src').and('include', 'blob:'); + }); + cy.getByData('select-turma-id').should('exist').click(); + cy.getByData('select-item-1').should('exist').click(); + + cy.getByData('btn-criar-modulo').should('exist').click(); + cy.getByData('msg-erro-descricao-cadastrar-modulo').should('contain', 'Descrição é obrigatória.'); + }); + + it('Deve retornar um erro ao tentar cadastrar um módulo sem preencher a imagem.', () => { + cy.visit(urlPORT3000 + "/modulos/cadastrar"); + + cy.getByData('input-titulo').should('exist').type('Fazendo o teste do cypress'); + cy.getByData('card-criar-modulo').within(() => { + cy.get('h3').should('contain', 'Fazendo o teste do cypress'); + }); + cy.getByData('input-descricao').should('exist').type('Sombras dançam em labirintos etéreos...'); + cy.getByData('card-criar-modulo').within(() => { + cy.get('p').should('contain', 'Sombras dançam em labirintos etéreos...'); + }); + cy.getByData('select-turma-id').should('exist').click(); + cy.getByData('select-item-1').should('exist').click(); + + cy.getByData('btn-criar-modulo').should('exist').click(); + cy.getByData('msg-erro-imagem-cadastrar-modulo').should('contain', 'Selecione uma imagem.'); + }); + + it('Deve retornar um erro ao tentar cadastrar um módulo sem preencher a turma.', () => { + cy.visit(urlPORT3000 + "/modulos/cadastrar"); + + cy.getByData('input-titulo').should('exist').type('Fazendo o teste do cypress'); + cy.getByData('card-criar-modulo').within(() => { + cy.get('h3').should('contain', 'Fazendo o teste do cypress'); + }); + cy.getByData('input-descricao').should('exist').type('Sombras dançam em labirintos etéreos...'); + cy.getByData('card-criar-modulo').within(() => { + cy.get('p').should('contain', 'Sombras dançam em labirintos etéreos...'); + }); + cy.getByData('input-imagem').should('exist').selectFile('cypress/fixtures/random.png', { force: true }); + cy.getByData('card-criar-modulo').within(() => { + cy.get('img').should('have.attr', 'src').and('include', 'blob:'); + }); + + cy.getByData('btn-criar-modulo').should('exist').click(); + cy.getByData('msg-erro-turma-cadastrar-modulo').should('contain', 'Você precisa selecionar uma turma.'); + }); + + //Fazer o erro de quando o card de mensagem de envio não aparecer + }); +}); \ No newline at end of file diff --git a/cypress/e2e/5-tela-usuarios/renderizar-telas.cy.js b/cypress/e2e/5-tela-usuarios/renderizar-telas.cy.js new file mode 100644 index 0000000000000000000000000000000000000000..128a372514f74216b0583a8cf50fc31553b35d59 --- /dev/null +++ b/cypress/e2e/5-tela-usuarios/renderizar-telas.cy.js @@ -0,0 +1,63 @@ +describe('Testando os caminhos felizes.', () => { + it('Realizando login com um usuário valido.', () => { + + cy.intercept('POST', 'http://localhost:3051/login').as('postRequest'); + + cy.visit('http://localhost:3002/login')//3000 + + cy.login('123456', 'senhatest') + + cy.wait(1000) + + cy.wait('@postRequest').then((interception) => { + expect(interception.response.statusCode).to.eq(200); + + expect(interception.response.body).to.have.property('error', false); + }); + + cy.url().should('include', '/modulos') + + cy.getByData('nav-menu').find('li a').contains('Usuários').should('exist'); + }); + it('Adentrando a tela de usuário e visualizando informações.', () => { + cy.viewport(1920, 1080) + cy.visit('http://localhost:3002/modulos') + cy.get('ul[data-test="nav-menu"] li a').contains('Usuários').click(); + cy.wait(1000) + cy.get('ul[data-test="nav-menu"] li a').contains('Usuários').should('have.class', 'border-verde'); + cy.getByData('paginaUsuarios').should('exist'); + cy.getByData('tituloUsuarios').should('exist'); + cy.getByData('tituloUsuarios').contains('Usuários'); + cy.getByData('labelFiltroNome').should('exist'); + cy.getByData('inputFiltroNome').should('exist').and('have.attr', 'placeholder', 'Ex: Ana Souza'); + cy.getByData('labelFiltroStatus').should('exist'); + cy.get('input[name="matricula"]').should('exist').and('have.attr', 'placeholder', 'Ex: 2023102270006'); + cy.get('button[role="combobox"]').should('exist').and('contain', 'Selecione'); + cy.getByData('botaoCadastrarUsuario').should('exist').and('contain', 'Cadastrar Usuario'); + + cy.get('table[data-test="tabelaUsuarios"]').should('exist'); + cy.get('thead[data-test="cabecalhoTabelaUsuarios"]').within(() => { + cy.get('th[data-test="colunaNome"]').should('contain', 'Nome'); + cy.get('th[data-test="colunaMatricula"]').should('contain', 'MatrÃcula'); + cy.get('th[data-test="colunaStatus"]').should('contain', 'Status'); + cy.get('th[data-test="colunaEditar"]').should('contain', 'Editar'); + }); + + cy.get('nav[data-test="paginacaoUsuarios"]').within(() => { + cy.get('a[data-test="botaoPaginaAnterior"]').should('exist'); + cy.get('a[data-test="pagina-1"]').should('exist'); + cy.get('a[data-test="pagina-2"]').should('exist'); + cy.get('a[data-test="botaoProximaPagina"]').should('exist'); + }); + + cy.get('footer').should('exist'); + cy.get('footer').within(() => { + cy.get('img[alt="Logo 4M"]').should('exist'); + cy.get('img[alt="FSLab"]').should('exist'); + cy.get('img[alt="Instituto Federal Rondônia"]').should('exist'); + cy.contains('Aprimore suas habilidades e supere desafios matemáticos com confiança').should('exist'); + cy.contains('Copyright © 2025. Todos os direitos reservados aos desenvolvedores.').should('exist'); + cy.contains('Saiba mais').should('have.attr', 'href', 'https://www.youtube.com/watch?v=dQw4w9WgXcQ').click(); + }); + }); +}); \ No newline at end of file diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 443acfee0ddf70c0edc62aad83b84d692a6f5d17..9dceb1a0aa14fa95702e4c9d09423b0610cb1734 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -7,15 +7,17 @@ // commands please read more here: // https://on.cypress.io/custom-commands // *********************************************** - +import 'cypress-file-upload'; // Import the cypress-file-upload plugin Cypress.Commands.add('getByData', (seletor) => { return cy.get(`[data-test=${seletor}]`) }); -// -// -- This is a parent command -- -// Cypress.Commands.add('login', (email, password) => { ... }) -// +Cypress.Commands.add('login', (usuario, senha) => { + cy.getByData('inputMatricula').type(`${usuario}`); + cy.getByData('inputSenha').type(`${senha}`, {log: false}); + cy.getByData('form-submit').click(); +}); + // // -- This is a child command -- // Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) diff --git "a/documenta\303\247\303\243o/dicas.md" "b/documenta\303\247\303\243o/dicas.md" index de04a98459807473c5ac1ed55061ae51e83bc5f0..3c35241cf1e28248c033cba062e1ae32304b8d7b 100644 --- "a/documenta\303\247\303\243o/dicas.md" +++ "b/documenta\303\247\303\243o/dicas.md" @@ -1,5 +1,11 @@ # Dicas +## Geral + +- `alt+shift+f` -> Formatação do código no windows; +- `ctrl+shift+i` -> Formatação do código no Linux; +- `COMMAND + SHIFT + P` -> Formatação do código no MAC; + ## Comandos do Git - `git add . && git commit -m "Insira uma mensagem" && git push origin 0-insira-sua-branch` Adiciona, comita e envia alterações para a branch especificada; @@ -10,7 +16,7 @@ - `git stash pop`; Aplica as mudanças salvas no stash e remove-as do stash; - `git reset --hard HEAD`; Desfaz todas as mudanças não comitadas; - `git reflog`; Mostra um histórico de todos os comandos git executados; -//git rm --cached cypress/screenshots -r para apagar o cache do cypress +- `git rm --cached cypress/screenshots -r para apagar o cache do cypress` ## Docker diff --git a/package-lock.json b/package-lock.json index d8e6e2ac39355df230832d8fce552a7e77f3d59f..7ef44eef05c8f1eb272d1f61196cb1c876b51773 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,6 +29,7 @@ "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "cmdk": "^1.0.0", + "cypress-file-upload": "^5.0.8", "dotenv": "^16.4.7", "json-server": "^1.0.0-beta.3", "lucide-react": "^0.468.0", @@ -228,7 +229,6 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", - "dev": true, "license": "MIT", "optional": true, "engines": { @@ -239,7 +239,6 @@ "version": "3.0.7", "resolved": "https://registry.npmjs.org/@cypress/request/-/request-3.0.7.tgz", "integrity": "sha512-LzxlLEMbBOPYB85uXrDqvD4MgcenjRBLIns3zyhx7vTPj/0u2eQhzXvPiGcaJrV38Q9dbkExWp6cOHPJ+EtFYg==", - "dev": true, "license": "Apache-2.0", "dependencies": { "aws-sign2": "~0.7.0", @@ -269,7 +268,6 @@ "version": "1.2.4", "resolved": "https://registry.npmjs.org/@cypress/xvfb/-/xvfb-1.2.4.tgz", "integrity": "sha512-skbBzPggOVYCbnGgV+0dmBdW/s77ZkAOXIC1knS8NagwDjBrNC1LuXtQJeiN6l+m7lzmHtaoUw/ctJKdqkG57Q==", - "dev": true, "license": "MIT", "dependencies": { "debug": "^3.1.0", @@ -280,7 +278,6 @@ "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, "license": "MIT", "dependencies": { "ms": "^2.1.1" @@ -2578,7 +2575,6 @@ "version": "22.10.2", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.2.tgz", "integrity": "sha512-Xxr6BBRCAOQixvonOye19wnzyDiUtTeqldOOmj3CkeblonbccA12PFwlufvRdrpjXxqnmUaeiU5EOA+7s5diUQ==", - "dev": true, "license": "MIT", "optional": true, "dependencies": { @@ -2620,21 +2616,18 @@ "version": "8.1.1", "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.1.tgz", "integrity": "sha512-0kSuKjAS0TrGLJ0M/+8MaFkGsQhZpB6pxOmvS3K8FYI72K//YmdfoW9X2qPsAKh1mkwxGD5zib9s1FIFed6E8g==", - "dev": true, "license": "MIT" }, "node_modules/@types/sizzle": { "version": "2.3.9", "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.9.tgz", "integrity": "sha512-xzLEyKB50yqCUPUJkIsrVvoWNfFUbIZI+RspLWt8u+tIW/BetMBZtgV2LY/2o+tYH8dRvQ+eoPf3NdhQCcLE2w==", - "dev": true, "license": "MIT" }, "node_modules/@types/yauzl": { "version": "2.10.3", "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz", "integrity": "sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==", - "dev": true, "license": "MIT", "optional": true, "dependencies": { @@ -2645,7 +2638,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", - "dev": true, "license": "MIT", "dependencies": { "clean-stack": "^2.0.0", @@ -2659,7 +2651,6 @@ "version": "4.1.3", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -2669,7 +2660,6 @@ "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", - "dev": true, "license": "MIT", "dependencies": { "type-fest": "^0.21.3" @@ -2685,7 +2675,6 @@ "version": "0.21.3", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", - "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" @@ -2741,7 +2730,6 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/arch/-/arch-2.2.0.tgz", "integrity": "sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ==", - "dev": true, "funding": [ { "type": "github", @@ -2780,7 +2768,6 @@ "version": "0.2.6", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", - "dev": true, "license": "MIT", "dependencies": { "safer-buffer": "~2.1.0" @@ -2790,7 +2777,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", - "dev": true, "license": "MIT", "engines": { "node": ">=0.8" @@ -2800,7 +2786,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -2810,21 +2795,18 @@ "version": "3.2.6", "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", - "dev": true, "license": "MIT" }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true, "license": "MIT" }, "node_modules/at-least-node": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", - "dev": true, "license": "ISC", "engines": { "node": ">= 4.0.0" @@ -2871,7 +2853,6 @@ "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", - "dev": true, "license": "Apache-2.0", "engines": { "node": "*" @@ -2881,7 +2862,6 @@ "version": "1.13.2", "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.13.2.tgz", "integrity": "sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==", - "dev": true, "license": "MIT" }, "node_modules/babel-plugin-macros": { @@ -2929,7 +2909,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", - "dev": true, "license": "BSD-3-Clause", "dependencies": { "tweetnacl": "^0.14.3" @@ -2986,14 +2965,12 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/blob-util/-/blob-util-2.0.2.tgz", "integrity": "sha512-T7JQa+zsXXEa6/8ZhHcQEW1UFfVM49Ts65uBkFL6fz2QmrElqmbajIDJvuA0tEhRe5eIjpV9ZF+0RfZR9voJFQ==", - "dev": true, "license": "Apache-2.0" }, "node_modules/bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "dev": true, "license": "MIT" }, "node_modules/brace-expansion": { @@ -3053,7 +3030,6 @@ "version": "5.7.1", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "dev": true, "funding": [ { "type": "github", @@ -3078,7 +3054,6 @@ "version": "0.2.13", "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", - "dev": true, "license": "MIT", "engines": { "node": "*" @@ -3099,7 +3074,6 @@ "version": "2.4.0", "resolved": "https://registry.npmjs.org/cachedir/-/cachedir-2.4.0.tgz", "integrity": "sha512-9EtFOZR8g22CL7BWjJ9BUx1+A/djkofnyW3aOXZORNW2kxoUpx2h+uN2cOqwPmFhnpVmxg+KW2OjOSgChTEvsQ==", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -3109,7 +3083,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", - "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", @@ -3123,7 +3096,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz", "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", - "dev": true, "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.1", @@ -3178,7 +3150,6 @@ "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", - "dev": true, "license": "Apache-2.0" }, "node_modules/chalk": { @@ -3197,7 +3168,6 @@ "version": "2.24.0", "resolved": "https://registry.npmjs.org/check-more-types/-/check-more-types-2.24.0.tgz", "integrity": "sha512-Pj779qHxV2tuapviy1bSZNEL1maXr13bPYpsvSDB68HlYcYuhlDrmGd63i0JHMCLKzc7rUSNIrpdJlhVlNwrxA==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.8.0" @@ -3222,7 +3192,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.1.0.tgz", "integrity": "sha512-HutrvTNsF48wnxkzERIXOe5/mlcfFcbfCmwcg6CJnizbSue78AbDt+1cgl26zwn61WFxhcPykPfZrbqjGmBb4A==", - "dev": true, "funding": [ { "type": "github", @@ -3250,7 +3219,6 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -3260,7 +3228,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", - "dev": true, "license": "MIT", "dependencies": { "restore-cursor": "^3.1.0" @@ -3285,7 +3252,6 @@ "version": "0.6.5", "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.5.tgz", "integrity": "sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ==", - "dev": true, "license": "MIT", "dependencies": { "string-width": "^4.2.0" @@ -3301,7 +3267,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz", "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", - "dev": true, "license": "MIT", "dependencies": { "slice-ansi": "^3.0.0", @@ -3407,7 +3372,6 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, "license": "MIT", "dependencies": { "delayed-stream": "~1.0.0" @@ -3429,7 +3393,6 @@ "version": "1.8.2", "resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.2.tgz", "integrity": "sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==", - "dev": true, "license": "MIT", "engines": { "node": ">=4.0.0" @@ -3453,7 +3416,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", - "dev": true, "license": "MIT" }, "node_modules/cosmiconfig": { @@ -3508,7 +3470,6 @@ "version": "13.16.1", "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.16.1.tgz", "integrity": "sha512-17FtCaz0cx7ssWYKXzGB0Vub8xHwpVPr+iPt2fHhLMDhVAPVrplD+rTQsZUsfb19LVBn5iwkEUFjQ1yVVJXsLA==", - "dev": true, "hasInstallScript": true, "license": "MIT", "dependencies": { @@ -3563,11 +3524,21 @@ "node": "^16.0.0 || ^18.0.0 || >=20.0.0" } }, + "node_modules/cypress-file-upload": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/cypress-file-upload/-/cypress-file-upload-5.0.8.tgz", + "integrity": "sha512-+8VzNabRk3zG6x8f8BWArF/xA/W0VK4IZNx3MV0jFWrJS/qKn8eHfa5nU73P9fOQAgwHFJx7zjg4lwOnljMO8g==", + "engines": { + "node": ">=8.2.1" + }, + "peerDependencies": { + "cypress": ">3.0.0" + } + }, "node_modules/cypress/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -3584,7 +3555,6 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -3597,7 +3567,6 @@ "version": "6.2.1", "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", - "dev": true, "license": "MIT", "engines": { "node": ">= 6" @@ -3607,7 +3576,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", - "dev": true, "license": "MIT", "dependencies": { "cross-spawn": "^7.0.0", @@ -3631,7 +3599,6 @@ "version": "9.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", - "dev": true, "license": "MIT", "dependencies": { "at-least-node": "^1.0.0", @@ -3647,7 +3614,6 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dev": true, "license": "MIT", "dependencies": { "pump": "^3.0.0" @@ -3663,7 +3629,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", - "dev": true, "license": "Apache-2.0", "engines": { "node": ">=8.12.0" @@ -3673,7 +3638,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -3686,7 +3650,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -3696,7 +3659,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", - "dev": true, "license": "MIT", "dependencies": { "path-key": "^3.0.0" @@ -3709,7 +3671,6 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, "license": "MIT", "dependencies": { "mimic-fn": "^2.1.0" @@ -3725,7 +3686,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -3735,7 +3695,6 @@ "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", - "dev": true, "license": "MIT", "dependencies": { "assert-plus": "^1.0.0" @@ -3801,7 +3760,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "dev": true, "license": "MIT", "engines": { "node": ">=0.4.0" @@ -3876,7 +3834,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", - "dev": true, "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.1", @@ -3897,7 +3854,6 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", - "dev": true, "license": "MIT", "dependencies": { "jsbn": "~0.1.0", @@ -3920,7 +3876,6 @@ "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dev": true, "license": "MIT", "dependencies": { "once": "^1.4.0" @@ -3930,7 +3885,6 @@ "version": "2.4.1", "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", - "dev": true, "license": "MIT", "dependencies": { "ansi-colors": "^4.1.1", @@ -3953,7 +3907,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -3963,7 +3916,6 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -3982,7 +3934,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", - "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0" @@ -4028,7 +3979,6 @@ "version": "6.4.7", "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.7.tgz", "integrity": "sha512-tYUSVOGeQPKt/eC1ABfhHy5Xd96N3oIijJvN3O9+TsC28T5V9yX9oEfEK5faP0EFSNVOG97qtAS68GBrQB2hDg==", - "dev": true, "license": "MIT" }, "node_modules/execa": { @@ -4058,7 +4008,6 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/executable/-/executable-4.1.1.tgz", "integrity": "sha512-8iA79xD3uAch729dUG8xaaBBFGaEa0wdD2VkYLFHwlqosEj/jT66AzcreRDSgV7ehnNLBW2WR5jIXwGKjVdTLg==", - "dev": true, "license": "MIT", "dependencies": { "pify": "^2.2.0" @@ -4071,14 +4020,12 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true, "license": "MIT" }, "node_modules/extract-zip": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", - "dev": true, "license": "BSD-2-Clause", "dependencies": { "debug": "^4.1.1", @@ -4099,7 +4046,6 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dev": true, "license": "MIT", "dependencies": { "pump": "^3.0.0" @@ -4115,7 +4061,6 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", - "dev": true, "engines": [ "node >=0.6.0" ], @@ -4162,7 +4107,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", - "dev": true, "license": "MIT", "dependencies": { "pend": "~1.2.0" @@ -4195,7 +4139,6 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", - "dev": true, "license": "MIT", "dependencies": { "escape-string-regexp": "^1.0.5" @@ -4211,7 +4154,6 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, "license": "MIT", "engines": { "node": ">=0.8.0" @@ -4267,7 +4209,6 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", - "dev": true, "license": "Apache-2.0", "engines": { "node": "*" @@ -4277,7 +4218,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", - "dev": true, "license": "MIT", "dependencies": { "asynckit": "^0.4.0", @@ -4354,7 +4294,6 @@ "version": "1.2.6", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.6.tgz", "integrity": "sha512-qxsEs+9A+u85HhllWJJFicJfPDhRmjzoYdl64aMWW9yRIJmSyxdn8IEkuIM530/7T+lv0TIHd8L6Q/ra0tEoeA==", - "dev": true, "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.1", @@ -4400,7 +4339,6 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/getos/-/getos-3.2.1.tgz", "integrity": "sha512-U56CfOK17OKgTVqozZjUKNdkfEv6jk5WISBJ8SHoagjE6L69zOwl3Z+O8myjY9MEW3i2HPWQBt/LTbCgcC973Q==", - "dev": true, "license": "MIT", "dependencies": { "async": "^3.2.0" @@ -4410,7 +4348,6 @@ "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", - "dev": true, "license": "MIT", "dependencies": { "assert-plus": "^1.0.0" @@ -4452,7 +4389,6 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.1.tgz", "integrity": "sha512-NBcGGFbBA9s1VzD41QXDG+3++t9Mn5t1FpLdhESY6oKY4gYTFpX4wO3sqGUa0Srjtbfj3szX0RnemmrVRUdULA==", - "dev": true, "license": "MIT", "dependencies": { "ini": "2.0.0" @@ -4477,7 +4413,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -4496,7 +4431,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -4506,7 +4440,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -4555,7 +4488,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.4.0.tgz", "integrity": "sha512-G5akfn7eKbpDN+8nPS/cb57YeA1jLTVxjpCj7tmm3QKPdyDy7T+qSC40e9ptydSWvkwjSXw1VbkpyEm39ukeAg==", - "dev": true, "license": "MIT", "dependencies": { "assert-plus": "^1.0.0", @@ -4621,7 +4553,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -4646,7 +4577,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", - "dev": true, "license": "ISC", "engines": { "node": ">=10" @@ -4728,7 +4658,6 @@ "version": "0.4.0", "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==", - "dev": true, "license": "MIT", "dependencies": { "global-dirs": "^3.0.0", @@ -4766,7 +4695,6 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -4788,14 +4716,12 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", - "dev": true, "license": "MIT" }, "node_modules/is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", - "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -4814,7 +4740,6 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", - "dev": true, "license": "MIT" }, "node_modules/jackspeak": { @@ -4859,7 +4784,6 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", - "dev": true, "license": "MIT" }, "node_modules/jsesc": { @@ -4884,7 +4808,6 @@ "version": "0.4.0", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", - "dev": true, "license": "(AFL-2.1 OR BSD-3-Clause)" }, "node_modules/json-server": { @@ -4930,7 +4853,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", - "dev": true, "license": "ISC" }, "node_modules/json5": { @@ -4961,7 +4883,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-2.0.2.tgz", "integrity": "sha512-gqXddjPqQ6G40VdnI6T6yObEC+pDNvyP95wdQhkWkg7crHH3km5qP1FsOXEkzEQwnz6gz5qGTn1c2Y52wP3OyQ==", - "dev": true, "engines": [ "node >=0.6.0" ], @@ -4986,7 +4907,6 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/lazy-ass/-/lazy-ass-1.6.0.tgz", "integrity": "sha512-cc8oEVoctTvsFZ/Oje/kGnHbpWHYBe8IAJe4C0QNc3t8uM/0Y8+erSz/7Y1ALuXTEZTMvxXwO6YbX1ey3ujiZw==", - "dev": true, "license": "MIT", "engines": { "node": "> 0.8" @@ -5014,7 +4934,6 @@ "version": "3.14.0", "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.14.0.tgz", "integrity": "sha512-TyWI8G99GX9GjE54cJ+RrNMcIFBfwMPxc3XTFiAYGN4s10hWROGtOg7+O6u6LE3mNkyld7RSLE6nrKBvTfcs3g==", - "dev": true, "license": "MIT", "dependencies": { "cli-truncate": "^2.1.0", @@ -5048,21 +4967,18 @@ "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true, "license": "MIT" }, "node_modules/lodash.once": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", - "dev": true, "license": "MIT" }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", - "dev": true, "license": "MIT", "dependencies": { "chalk": "^4.1.0", @@ -5079,7 +4995,6 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -5096,7 +5011,6 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -5109,7 +5023,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/log-update/-/log-update-4.0.0.tgz", "integrity": "sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==", - "dev": true, "license": "MIT", "dependencies": { "ansi-escapes": "^4.3.0", @@ -5128,7 +5041,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", @@ -5146,7 +5058,6 @@ "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", @@ -5203,7 +5114,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.0.0.tgz", "integrity": "sha512-4MqMiKP90ybymYvsut0CH2g4XWbfLtmlCkXmtmdcDCxNB+mQcu1w/1+L/VD7vi/PSv7X2JYV7SCcR+jiPXnQtA==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -5271,7 +5181,6 @@ "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.6" @@ -5281,7 +5190,6 @@ "version": "2.1.35", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, "license": "MIT", "dependencies": { "mime-db": "1.52.0" @@ -5321,7 +5229,6 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" @@ -5615,7 +5522,6 @@ "version": "1.13.3", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -5628,7 +5534,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, "license": "ISC", "dependencies": { "wrappy": "1" @@ -5786,14 +5691,12 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/ospath/-/ospath-1.2.2.tgz", "integrity": "sha512-o6E5qJV5zkAbIDNhGSIlyOhScKXgQrSRMilfph0clDfM0nEnBOlKlH4sWDmG95BW/CvwNz0vmm7dJVtU2KlMiA==", - "dev": true, "license": "MIT" }, "node_modules/p-map": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", - "dev": true, "license": "MIT", "dependencies": { "aggregate-error": "^3.0.0" @@ -5885,14 +5788,12 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", - "dev": true, "license": "MIT" }, "node_modules/performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", - "dev": true, "license": "MIT" }, "node_modules/picocolors": { @@ -6110,7 +6011,6 @@ "version": "5.6.0", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", "integrity": "sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -6128,7 +6028,6 @@ "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.6.0" @@ -6168,14 +6067,12 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.0.0.tgz", "integrity": "sha512-F2JHgJQ1iqwnHDcQjVBsq3n/uoaFL+iPW/eAeL7kVxy/2RrWaN4WroKjjvbsoRtv0ftelNyC01bjRhn/bhcf4A==", - "dev": true, "license": "MIT" }, "node_modules/pump": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.2.tgz", "integrity": "sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==", - "dev": true, "license": "MIT", "dependencies": { "end-of-stream": "^1.1.0", @@ -6186,7 +6083,6 @@ "version": "6.13.1", "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.1.tgz", "integrity": "sha512-EJPeIn0CYrGu+hli1xilKAPXODtJ12T0sP63Ijx2/khC2JtuaN3JyNIpvmnkmaEtha9ocbG4A4cMcr+TvqvwQg==", - "dev": true, "license": "BSD-3-Clause", "dependencies": { "side-channel": "^1.0.6" @@ -6427,7 +6323,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-3.0.0.tgz", "integrity": "sha512-MnWzEHHaxHO2iWiQuHrUPBi/1WeBf5PkxQqNyNvLl9VAYSdXkP8tQ3pBSeCPD+yw0v0Aq1zosWLz0BdeXpWwZg==", - "dev": true, "license": "MIT", "dependencies": { "throttleit": "^1.0.0" @@ -6463,7 +6358,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", - "dev": true, "license": "MIT", "dependencies": { "onetime": "^5.1.0", @@ -6477,7 +6371,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -6487,7 +6380,6 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, "license": "MIT", "dependencies": { "mimic-fn": "^2.1.0" @@ -6513,7 +6405,6 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", - "dev": true, "license": "MIT" }, "node_modules/run-parallel": { @@ -6543,7 +6434,6 @@ "version": "7.8.1", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", - "dev": true, "license": "Apache-2.0", "dependencies": { "tslib": "^2.1.0" @@ -6573,7 +6463,6 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true, "license": "MIT" }, "node_modules/scheduler": { @@ -6589,7 +6478,6 @@ "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", - "devOptional": true, "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -6663,7 +6551,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", - "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", @@ -6683,7 +6570,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", - "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", @@ -6700,7 +6586,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", - "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.2", @@ -6719,7 +6604,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", - "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.2", @@ -6782,7 +6666,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz", "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", @@ -6830,7 +6713,6 @@ "version": "1.18.0", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", - "dev": true, "license": "MIT", "dependencies": { "asn1": "~0.2.3", @@ -7026,7 +6908,6 @@ "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -7179,7 +7060,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-1.0.1.tgz", "integrity": "sha512-vDZpf9Chs9mAdfY046mcPt8fg5QSZr37hEH4TXYBnDF+izxgrbRGUAAaBvIk/fJm9aOFCGFd1EsNg5AZCbnQCQ==", - "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -7189,14 +7069,12 @@ "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", - "dev": true, "license": "MIT" }, "node_modules/tldts": { "version": "6.1.68", "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.68.tgz", "integrity": "sha512-JKF17jROiYkjJPT73hUTEiTp2OBCf+kAlB+1novk8i6Q6dWjHsgEjw9VLiipV4KTJavazXhY1QUXyQFSem2T7w==", - "dev": true, "license": "MIT", "dependencies": { "tldts-core": "^6.1.68" @@ -7209,14 +7087,12 @@ "version": "6.1.68", "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.68.tgz", "integrity": "sha512-85TdlS/DLW/gVdf2oyyzqp3ocS30WxjaL4la85EArl9cHUR/nizifKAJPziWewSZjDZS71U517/i6ciUeqtB5Q==", - "dev": true, "license": "MIT" }, "node_modules/tmp": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", "integrity": "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==", - "dev": true, "license": "MIT", "engines": { "node": ">=14.14" @@ -7247,7 +7123,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.0.0.tgz", "integrity": "sha512-FRKsF7cz96xIIeMZ82ehjC3xW2E+O2+v11udrDYewUbszngYhsGa8z6YUMMzO9QJZzzyd0nGGXnML/TReX6W8Q==", - "dev": true, "license": "BSD-3-Clause", "dependencies": { "tldts": "^6.1.32" @@ -7260,7 +7135,6 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", - "dev": true, "license": "MIT", "bin": { "tree-kill": "cli.js" @@ -7282,7 +7156,6 @@ "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", - "dev": true, "license": "Apache-2.0", "dependencies": { "safe-buffer": "^5.0.1" @@ -7295,7 +7168,6 @@ "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", - "dev": true, "license": "Unlicense" }, "node_modules/type-fest": { @@ -7314,7 +7186,6 @@ "version": "6.20.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", - "dev": true, "license": "MIT", "optional": true }, @@ -7331,7 +7202,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -7429,7 +7299,6 @@ "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true, "license": "MIT", "bin": { "uuid": "dist/bin/uuid" @@ -7439,7 +7308,6 @@ "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", - "dev": true, "engines": [ "node >=0.6.0" ], @@ -7487,7 +7355,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", @@ -7523,7 +7390,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true, "license": "ISC" }, "node_modules/yaml": { @@ -7539,7 +7405,6 @@ "version": "2.10.0", "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", - "dev": true, "license": "MIT", "dependencies": { "buffer-crc32": "~0.2.3", diff --git a/package.json b/package.json index 718641b02b8d14ae72ae18b0d1cb55f78711f29e..fc1c374ca79805f02fa30c4589c56d461b00ad34 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "cmdk": "^1.0.0", + "cypress-file-upload": "^5.0.8", "dotenv": "^16.4.7", "json-server": "^1.0.0-beta.3", "lucide-react": "^0.468.0", diff --git a/src/app/(auth)/layout.jsx b/src/app/(auth)/layout.jsx index 2d402897ce3f1bbcb8022ddf3b4c828380ae282d..32e38376758abc76e305df686890b7fb330cdbfc 100644 --- a/src/app/(auth)/layout.jsx +++ b/src/app/(auth)/layout.jsx @@ -7,13 +7,15 @@ export default async function AuthLayout({ children }) { const session = await auth(); const token = await getCookie("access_token"); - const permissoes = await getCookie("permissoes"); + const permissoes = await getCookie("PermissoesUser"); + const nome = await getCookie("nome"); + const matricula = await getCookie("matricula"); if (!session) { redirect("/login"); } return ( - <ApplicationProvider token={token} permissoes={permissoes}> + <ApplicationProvider token={token} permissoes={permissoes} nome={nome} matricula={matricula}> <>{children}</> </ApplicationProvider> ); diff --git a/src/app/(auth)/modulos/cadastrar/page.jsx b/src/app/(auth)/modulos/cadastrar/page.jsx index 40e195168939b8c8aa4bc7dfe470820746f3cec3..a8886a3d377219e1f451c7cb04daa4b2a8e7ed22 100644 --- a/src/app/(auth)/modulos/cadastrar/page.jsx +++ b/src/app/(auth)/modulos/cadastrar/page.jsx @@ -90,6 +90,7 @@ export default function ModulosCadastrar() { title: "Módulo criado com sucesso.", description: "", className: "bg-green-500 text-white text-xl", + "data-test": "toast-sucesso-criar-modulo" }); form.reset(); // Reset form inputs to default values } diff --git a/src/app/(auth)/usuarios/page.jsx b/src/app/(auth)/usuarios/page.jsx index e3884e26a8166bd3c1cc9e251da850bf6e8404c9..9dc8a73b641b96e649f97f54337559144957d35c 100644 --- a/src/app/(auth)/usuarios/page.jsx +++ b/src/app/(auth)/usuarios/page.jsx @@ -117,7 +117,7 @@ export default function Example() { if (isLoading) { return ( - <main className="flex items-center justify-center h-screen"> + <main className="flex items-center justify-center h-screen" data-test="loadingdCircle"> <div className="border-t-4 border-verde border-solid w-16 h-16 rounded-full animate-spin"></div> </main> ); @@ -126,12 +126,12 @@ export default function Example() { if (error) return <span>Ocorreu um erro: {error.message}</span>; return ( - <div className="min-h-screen flex flex-col gap-4"> + <div className="min-h-screen flex flex-col gap-4" data-test="paginaUsuarios"> <Header texto={{}} link={{}} mainPage="usuarios" /> <div className="flex-grow"> <div className="flex justify-center items-center w-full"> <div className="flex justify-center flex-col items-center pt-10 max-w-screen-xl w-full"> - <h1 className="text-5xl pb-10">Usuários</h1> + <h1 className="text-5xl pb-10" data-test="tituloUsuarios">Usuários</h1> <FilterForm form={form} setSearchNome={setSearchNome} @@ -140,7 +140,6 @@ export default function Example() { setCurrentPage={setCurrentPage} setIsModalOpen={setIsModalOpen} /> - <div className="max-w-screen-xl w-full mt-12"> <UserTable paginatedData={paginatedData} handleEdit={handleEdit} /> <div className="pt-6 pb-20"> diff --git a/src/app/(no-auth)/layout.jsx b/src/app/(no-auth)/layout.jsx index 8a047b30ece95f40fdfd7c4fab694ab5d869fad5..464a04ca20df97798df5df2769fdb0710e025797 100644 --- a/src/app/(no-auth)/layout.jsx +++ b/src/app/(no-auth)/layout.jsx @@ -2,11 +2,11 @@ import { redirect } from "next/navigation"; import { auth } from "../../../auth"; export default async function NoAuthLayout({ children }) { - const session = await auth(); + const session = await auth(); - if (session) { - redirect("/modulos"); - } + if (session) { + redirect("/modulos"); + } - return <>{children}</>; + return <>{children}</>; } \ No newline at end of file diff --git a/src/components/VerificarPermissao.jsx b/src/components/VerificarPermissao.jsx index 25a31ccb54b5af876f2e0fbb93ccbcbcdd2eaee0..90399e979a87b807d13af3cbf4e6347f2aab0b69 100644 --- a/src/components/VerificarPermissao.jsx +++ b/src/components/VerificarPermissao.jsx @@ -1,25 +1,31 @@ "use client"; import { useState, useEffect } from "react"; -import { getCookie } from "@/actions/handleCookie"; +import { useSession } from "next-auth/react"; /** * @VerificarPermissao Tive que mexer neste componente, pois não consigui usar o ApllicationContext */ const VerificarPermissao = ({ rota, verbo, children }) => { + const { data: session, status } = useSession(); const [permissoes, setPermissoes] = useState([]); - + + console.log("Permissoes:", permissoes); + useEffect(() => { - async function fetchPermissoes() { - const permissoesCookie = await getCookie("PermissoesUser"); - if (permissoesCookie) { - setPermissoes(JSON.parse(permissoesCookie)); - } + if (status === "authenticated" && session.user.permissoes) { + setPermissoes(session.user.permissoes); } - fetchPermissoes(); - }, []); + }, [status, session]); + + if (status === "loading") { + return <p>Loading...</p>; + } + + if (status !== "authenticated") { + return <p>Not authenticated</p>; + } - // Praticamente a mesma coisa que o código passado const permissao = permissoes.find((p) => p.rota === rota); if (permissao && permissao[verbo]) { diff --git a/src/components/ui/formPostCSV.jsx b/src/components/ui/formPostCSV.jsx new file mode 100644 index 0000000000000000000000000000000000000000..81b2126e0963426cd69d133d566355185bb685e5 --- /dev/null +++ b/src/components/ui/formPostCSV.jsx @@ -0,0 +1,147 @@ +"use client"; + +import React, { useState } from "react"; +import { useForm } from "react-hook-form"; +import { useQuery } from "@tanstack/react-query"; +import { + Form, + FormControl, + FormField, + FormItem, + FormLabel, + FormMessage, +} from "@/components/ui/form"; +import { fetchApi } from "@/utils/fetchApi"; +import { InputArquivos } from "../ui/input-arquivos"; +import Submit from "../Submit"; + +export default function FormPostArquivos({ fecharModal }) { + const [arquivoCSV, setArquivoCSV] = useState(null); + + const { isLoading, error, data } = useQuery({ + queryKey: ["arquivosPost", arquivoCSV], + queryFn: async () => { + const response = await fetchApi( + process.env.NEXT_PUBLIC_API_URL + "arquivos", + "POST", + arquivoCSV, + process.env.NEXT_PUBLIC_PROFESSOR_TOKEN + ); + if (response.isError) { + throw response; + } else { + fecharModal() + return response; + } + }, + enabled: !!arquivoCSV, + }); + + const form = useForm({ + defaultValues: { + CSV: [], + }, + }); + + const { setValue } = form; + + const onSubmit = (data) => { + const formData = new FormData(); + + data.conteudo.forEach((file) => { + formData.append("conteudo", file); + }); + + data.CSV.forEach((file) => { + formData.append("CSV", file); + }); + formData.append("aula_id", aula?.id) + setArquivoCSV(formData); + + }; + + return ( + <Form {...form}> + <form onSubmit={form.handleSubmit(onSubmit)} className="space-y-6 flex flex-col items-center text-white"> + + <FormField + control={form.control} + name="CSV" + render={({ field }) => { + const [files, setFiles] = React.useState([]); + + const handleFileChange = (e) => { + const newFiles = Array.from(e.target.files); + const updatedFiles = [...files, ...newFiles]; + + const uniqueFiles = updatedFiles.reduce((acc, file) => { + if (!acc.find((f) => f.name === file.name)) { + acc.push(file); + } + return acc; + }, []); + + setFiles(uniqueFiles); + field.onChange(uniqueFiles); + + // Reseta o valor do input + e.target.value = ""; + }; + + const removeFile = (fileName) => { + const updatedFiles = files.filter((file) => file.name !== fileName); + setFiles(updatedFiles); + field.onChange(updatedFiles); + }; + + return ( + <FormItem> + <div className="flex flex-col w-72 pb-5"> + <div className="flex items-center justify-between"> + <FormLabel className="mb-2">CSV</FormLabel> + <FormControl> + <InputArquivos + id="CSV" + multiple + onChange={handleFileChange} + /> + </FormControl> + </div> + <div className="mt-2 text-sm space-y-2"> + {files.map((file) => ( + <div key={file.name} className="flex items-center justify-start"> + <button + type="button" + onClick={() => removeFile(file.name)} + className="ml-2" + > + <img + src="/lixeiraVermelha.png" + alt="Remover arquivo" + className="h-5 w-5" + /> + </button> + <span + className="truncate max-w-[calc(100%-2rem)]" + title={file.name} + > + {file.name} + </span> + </div> + ))} + { files.length == 0 && <span>Nenhum arquivo selecionado</span>} + </div> + </div> + <FormMessage /> + </FormItem> + ); + }} + /> + + <Submit texto="Enviar" largura="12rem" /> + </form> + </Form> + ); +} + +export { FormPostArquivos }; diff --git a/src/components/userComponents/EditUserModal.jsx b/src/components/userComponents/EditUserModal.jsx index d89ec1eaadd9951469239e8654280fe780362ddc..cc6aa62a0f7f9ab24848c9df2ef4389abda999f8 100644 --- a/src/components/userComponents/EditUserModal.jsx +++ b/src/components/userComponents/EditUserModal.jsx @@ -10,10 +10,11 @@ export const EditUserModal = ({ isOpen, onClose, selectedEditUsuario, setSelecte e.preventDefault(); handleSaveEdit(selectedEditUsuario); }} + data-test="formEditarUsuario" > <div className="space-y-4"> <div> - <label className="block text-sm font-medium text-white">Nome</label> + <label className="block text-sm font-medium text-white" data-test="labelEditarNome">Nome</label> <input type="text" value={selectedEditUsuario?.nome || ""} @@ -24,10 +25,11 @@ export const EditUserModal = ({ isOpen, onClose, selectedEditUsuario, setSelecte }) } className="w-full p-2 border rounded bg-neutral-800 text-white" + data-test="inputEditarNome" /> </div> <div> - <label className="block text-sm font-medium text-white">MatrÃcula</label> + <label className="block text-sm font-medium text-white" data-test="labelEditarMatricula">MatrÃcula</label> <input type="text" value={selectedEditUsuario?.matricula || ""} @@ -38,10 +40,11 @@ export const EditUserModal = ({ isOpen, onClose, selectedEditUsuario, setSelecte }) } className="w-full p-2 border rounded bg-neutral-800 text-white" + data-test="inputEditarMatricula" /> </div> <div> - <label className="block text-sm font-medium text-white">Status</label> + <label className="block text-sm font-medium text-white" data-test="labelEditarStatus">Status</label> <select value={selectedEditUsuario?.active ? "true" : "false"} onChange={(e) => @@ -51,9 +54,10 @@ export const EditUserModal = ({ isOpen, onClose, selectedEditUsuario, setSelecte }) } className="w-full p-2 border rounded bg-neutral-800 text-white" + data-test="selectEditarStatus" > - <option value="true">Ativo</option> - <option value="false">Inativo</option> + <option value="true" data-test="optionAtivo">Ativo</option> + <option value="false" data-test="optionInativo">Inativo</option> </select> </div> </div> @@ -61,6 +65,7 @@ export const EditUserModal = ({ isOpen, onClose, selectedEditUsuario, setSelecte <Button type="submit" className="btn h-[33px] border border-cinza_c2 bg-verde rounded-md text-sm shadow-xl hover:text-white hover:bg-verde_escuro duration-300 w-[160px] text-black" + data-test="botaoSalvarEdicao" > Salvar </Button> diff --git a/src/components/userComponents/FilterForm.jsx b/src/components/userComponents/FilterForm.jsx index 7f4854f541e5d1593b02b5a6899734d59f871cef..69e798ed7c22af77140ba502774c57166d4ab0e2 100644 --- a/src/components/userComponents/FilterForm.jsx +++ b/src/components/userComponents/FilterForm.jsx @@ -19,7 +19,7 @@ import { Button } from "../ui/button"; export const FilterForm = ({ form, setSearchNome, setSearchMat, setSearchStatus, setCurrentPage, setIsModalOpen }) => { return ( - <Form {...form}> + <Form {...form} data-test="formFiltroUsuarios"> <div className="flex border-b-2 justify-between items-center w-full max-w-screen-xl"> <div className="flex flex-wrap gap-[35px] justify-center items-center mb-2"> <FormField @@ -27,7 +27,7 @@ export const FilterForm = ({ form, setSearchNome, setSearchMat, setSearchStatus, control={form.control} render={({ field }) => ( <FormItem> - <FormLabel>Nome</FormLabel> + <FormLabel data-test="labelFiltroNome">Nome</FormLabel> <FormControl> <Input type="text" @@ -40,6 +40,7 @@ export const FilterForm = ({ form, setSearchNome, setSearchMat, setSearchStatus, setCurrentPage(1); }} value={field.value || ""} + data-test="inputFiltroNome" /> </FormControl> </FormItem> @@ -73,7 +74,7 @@ export const FilterForm = ({ form, setSearchNome, setSearchMat, setSearchStatus, name="status" render={({ field }) => ( <FormItem> - <FormLabel className="">Status</FormLabel> + <FormLabel className="" data-test="labelFiltroStatus">Status</FormLabel> <Select onValueChange={(value) => { field.onChange(value); @@ -81,16 +82,17 @@ export const FilterForm = ({ form, setSearchNome, setSearchMat, setSearchStatus, setCurrentPage(1); }} value={field.value || ""} + data-test="selectFiltroStatus" > <SelectTrigger className="w-[130px] h-10 text-base border border-gray-300 rounded-md"> <SelectValue placeholder="Selecione" /> </SelectTrigger> <SelectContent> <SelectGroup> - <SelectItem value="true" className="w-[120px] h-10"> + <SelectItem value="true" className="w-[120px] h-10" data-test="selectItemAtivo"> Ativo </SelectItem> - <SelectItem value="false" className="w-[120px] h-10"> + <SelectItem value="false" className="w-[120px] h-10" data-test="selectItemInativo"> Inativo </SelectItem> </SelectGroup> @@ -102,8 +104,9 @@ export const FilterForm = ({ form, setSearchNome, setSearchMat, setSearchStatus, </div> <Button type="button" - className="btn h-10 border border-cinza_c2 bg-verde rounded-md text-sm shadow-xl hover:text-white hover:bg-verde_escuro duration-300 w-[160px] text-black ml-4" + className="btn h-10 border border-cinza_c2 bg-verde rounded-md text-sm shadow-xl hover:text-white hover:bg-verde_escuro duration-300 w-[160px] text-black ml-4 mt-4" onClick={() => setIsModalOpen(true)} + data-test="botaoCadastrarUsuario" > Cadastrar Usuario </Button> diff --git a/src/components/userComponents/FormCriarUsuarios.jsx b/src/components/userComponents/FormCriarUsuarios.jsx index cdb1e1ae71061b67f4d8ce074b8916c20fde2eb9..5fea49c0d397f50f669462004b9decc354d6c4fa 100644 --- a/src/components/userComponents/FormCriarUsuarios.jsx +++ b/src/components/userComponents/FormCriarUsuarios.jsx @@ -22,7 +22,7 @@ import Image from "next/image"; import { showToast } from "@/utils/responseMenssage"; import { FormPostCSV } from "./formPostCSV"; -export default function FormModalAula({ fecharModal, isOpen }) { +export default function FormModalUsuario({ fecharModal, isOpen }) { const form = useForm({ resolver: zodResolver(usuarioCreateSchema), defaultValues: { @@ -66,13 +66,14 @@ export default function FormModalAula({ fecharModal, isOpen }) { <form onSubmit={form.handleSubmit(onSubmit)} className="space-y-6 flex flex-col items-center text-white" + data-test="formCriarUsuario" > <FormField control={form.control} name="nome" render={({ field }) => ( <FormItem> - <FormLabel className="text-sm">Nome</FormLabel> + <FormLabel className="text-sm" data-test="labelNome">Nome</FormLabel> <FormControl> <Input data-test="inputNome" @@ -83,7 +84,7 @@ export default function FormModalAula({ fecharModal, isOpen }) { {...field} /> </FormControl> - <FormMessage data-test="errorNome" /> + <FormMessage data-test="erroNome" /> </FormItem> )} /> @@ -162,7 +163,7 @@ export default function FormModalAula({ fecharModal, isOpen }) { /> <Submit - dataTest="CriarUsuario" + dataTest="botaoCadastrarUsuario" texto="Cadastrar" largura="12rem" /> @@ -170,6 +171,7 @@ export default function FormModalAula({ fecharModal, isOpen }) { <label className="pt-4 flex items-center border-t-2 border-gray-400 cursor-pointer" onClick={() => setCSVModalOpen(true)} + data-test="labelCadastrarCSV" > <p className="p-2 hover:underline text-[15px]">Cadastrar alunos com CSV</p> <Image src="/editar-arquivo.png" alt="adicionar alunos" width={30} height={30} /> diff --git a/src/components/userComponents/PaginationComponent.jsx b/src/components/userComponents/PaginationComponent.jsx index 1b46ff915abdfc1a3c12ac9e8e8b915c6eb5d295..a1b1a66c803d985b334e46263410d03ac9c92e6c 100644 --- a/src/components/userComponents/PaginationComponent.jsx +++ b/src/components/userComponents/PaginationComponent.jsx @@ -10,12 +10,13 @@ import { export const PaginationComponent = ({ currentPage, totalPages, handlePageChange }) => { return ( - <Pagination> + <Pagination data-test="paginacaoUsuarios"> <PaginationContent> <PaginationItem> <PaginationPrevious href="#" onClick={() => handlePageChange(Math.max(currentPage - 1, 1))} + data-test="botaoPaginaAnterior" /> </PaginationItem> {Array.from({ length: totalPages }, (_, index) => ( @@ -24,6 +25,7 @@ import { href="#" isActive={currentPage === index + 1} onClick={() => handlePageChange(index + 1)} + data-test={`pagina-${index + 1}`} > {index + 1} </PaginationLink> @@ -33,6 +35,7 @@ import { <PaginationNext href="#" onClick={() => handlePageChange(Math.min(currentPage + 1, totalPages))} + data-test="botaoProximaPagina" /> </PaginationItem> </PaginationContent> diff --git a/src/components/userComponents/UserTable.jsx b/src/components/userComponents/UserTable.jsx index 15570fa37f4930ed7c9b5d8843be74cce237436d..505d10404df6ec54b28e809c097f1952baf3fb9d 100644 --- a/src/components/userComponents/UserTable.jsx +++ b/src/components/userComponents/UserTable.jsx @@ -12,48 +12,36 @@ import { Settings } from "lucide-react"; export const UserTable = ({ paginatedData, handleEdit }) => { return ( - <Table className="text-lg"> - <TableHeader> + <Table className="text-lg" data-test="tabelaUsuarios"> + <TableHeader data-test="cabecalhoTabelaUsuarios"> <TableRow> - <TableHead className="max-w-[500px]">Nome</TableHead> - <TableHead>MatrÃcula</TableHead> - <TableHead className="max-w-[500px]">Status</TableHead> - <TableHead className="max-w-[100px]">Editar</TableHead> + <TableHead data-test="colunaNome" className="w-1/4">Nome</TableHead> + <TableHead data-test="colunaMatricula" className="w-1/4">MatrÃcula</TableHead> + <TableHead data-test="colunaStatus" className="w-1/4">Status</TableHead> + <TableHead data-test="colunaEditar" className="w-1/4">Editar</TableHead> </TableRow> </TableHeader> - <TableBody> + <TableBody data-test="corpoTabelaUsuarios"> {paginatedData && paginatedData.map((usuario) => ( - <TableRow key={usuario.id} className="text-base"> - <TableCell className="font-medium">{usuario.nome}</TableCell> - <TableCell>{usuario.matricula}</TableCell> - <TableCell>{usuario.active ? "Ativo" : "Inativo"}</TableCell> - <TableCell> - <div className="relative"> - <Button - variant="ghost" - size="icon" - onClick={() => handleEdit(usuario.id)} - className="hover:bg-gray-100 transition-colors duration-200 relative" - onMouseEnter={(e) => { - const tooltip = e.currentTarget.querySelector(".tooltip"); - tooltip.classList.remove("hidden"); - }} - onMouseLeave={(e) => { - const tooltip = e.currentTarget.querySelector(".tooltip"); - tooltip.classList.add("hidden"); - }} - > - <Settings className="h-4 w-4" /> - <div className="tooltip hidden absolute -top-8 left-1/2 transform -translate-x-1/2 bg-gray-700 text-white text-xs px-2 py-1 rounded whitespace-nowrap"> - Gerenciar usuário - </div> - </Button> - </div> + <TableRow key={usuario.id} className="text-base" data-test={`linhaUsuario-${usuario.id}`}> + <TableCell className="font-medium w-1/4" data-test={`nomeUsuario-${usuario.id}`}>{usuario.nome}</TableCell> + <TableCell data-test={`matriculaUsuario-${usuario.id}`} className="w-1/4">{usuario.matricula}</TableCell> + <TableCell data-test={`statusUsuario-${usuario.id}`} className="w-1/4">{usuario.active ? "Ativo" : "Inativo"}</TableCell> + <TableCell className="w-1/4"> + <Button + variant="ghost" + size="icon" + onClick={() => handleEdit(usuario.id)} + className="hover:bg-gray-100 transition-colors duration-200 relative" + data-test={`botaoEditarUsuario-${usuario.id}`} + > + <Settings className="h-4 w-4" /> + </Button> </TableCell> </TableRow> ))} </TableBody> </Table> ); -}; \ No newline at end of file +}; diff --git a/src/components/userComponents/formPostCSV.jsx b/src/components/userComponents/formPostCSV.jsx index ae932eb7146201d0c436b427bf145d1ca55b3e11..4622cc55b390a172316e2fc1f70bb385d83e23eb 100644 --- a/src/components/userComponents/formPostCSV.jsx +++ b/src/components/userComponents/formPostCSV.jsx @@ -53,7 +53,7 @@ export function FormPostCSV({ fecharModal }) { return ( <Form {...form}> - <form onSubmit={form.handleSubmit(onSubmit)} className="space-y-6 flex flex-col items-center text-white"> + <form onSubmit={form.handleSubmit(onSubmit)} className="space-y-6 flex flex-col items-center text-white" data-test="formPostCSV"> <FormField control={form.control} name="csvFile" @@ -88,22 +88,24 @@ export function FormPostCSV({ fecharModal }) { <FormItem> <div className="flex flex-col w-72 pb-5"> <div className="flex items-center justify-between"> - <FormLabel className="mb-2">CSV</FormLabel> + <FormLabel className="mb-2" data-test="labelCSV">CSV</FormLabel> <FormControl> <InputArquivos id="csvFile" multiple onChange={handleFileChange} + data-test="inputCSV" /> </FormControl> </div> - <div className="mt-2 text-sm space-y-2"> + <div className="mt-2 text-sm space-y-2" data-test="listaArquivosCSV"> {files.map((file) => ( - <div key={file.name} className="flex items-center justify-start"> + <div key={file.name} className="flex items-center justify-start" data-test={`arquivoCSV-${file.name}`}> <button type="button" onClick={() => removeFile(file.name)} className="ml-2" + data-test={`botaoRemoverArquivo-${file.name}`} > <img src="/lixeiraVermelha.png" @@ -119,7 +121,7 @@ export function FormPostCSV({ fecharModal }) { </span> </div> ))} - {files.length === 0 && <span>Nenhum arquivo selecionado</span>} + {files.length === 0 && <span data-test="nenhumArquivoSelecionado">Nenhum arquivo selecionado</span>} </div> </div> <FormMessage /> @@ -127,7 +129,7 @@ export function FormPostCSV({ fecharModal }) { ); }} /> - <Submit texto="Enviar" largura="12rem" /> + <Submit texto="Enviar" largura="12rem" data-test="botaoEnviarCSV" /> </form> </Form> );