{
  "stats": {
    "suites": 1,
    "tests": 4,
    "passes": 2,
    "pending": 0,
    "failures": 2,
    "start": "2025-11-08T20:13:18.963Z",
    "end": "2025-11-08T20:13:30.062Z",
    "duration": 11099,
    "testsRegistered": 4,
    "passPercent": 50,
    "pendingPercent": 0,
    "other": 0,
    "hasOther": false,
    "skipped": 0,
    "hasSkipped": false
  },
  "results": [
    {
      "uuid": "820836d0-f257-4352-a999-577034b48021",
      "title": "",
      "fullFile": "cypress\\e2e\\relatorios_estoque.cy.js",
      "file": "cypress\\e2e\\relatorios_estoque.cy.js",
      "beforeHooks": [],
      "afterHooks": [],
      "tests": [],
      "suites": [
        {
          "uuid": "897d35f1-6516-42aa-a297-a4aabde0d4a2",
          "title": "Relatórios de Estoque",
          "fullFile": "",
          "file": "",
          "beforeHooks": [],
          "afterHooks": [],
          "tests": [
            {
              "title": "Renderiza a página e remove elementos antigos",
              "fullTitle": "Relatórios de Estoque Renderiza a página e remove elementos antigos",
              "timedOut": null,
              "duration": 2979,
              "state": "passed",
              "speed": "fast",
              "pass": true,
              "fail": false,
              "pending": false,
              "context": null,
              "code": "cy.visit('/relatorios/estoque');\ncy.wait(['@mov', '@thr']);\ncy.contains('h1', 'Relatórios de Estoque').should('be.visible');\ncy.contains('Atalhos').should('not.exist');\ncy.contains('Em construção').should('not.exist');\ncy.get('#tbl-movimentos thead').within(() => {\n  cy.contains('Data');\n  cy.contains('Produto');\n  cy.contains('Tipo');\n  cy.contains('Quantidade');\n  cy.contains('Motivo');\n  cy.contains('Origem');\n});\ncy.get('#mov-feedback').should('contain.text', 'movimentos encontrados');",
              "err": {},
              "uuid": "e73d2ced-8f75-48b4-9ad0-ca699bf30e58",
              "parentUUID": "897d35f1-6516-42aa-a297-a4aabde0d4a2",
              "isHook": false,
              "skipped": false
            },
            {
              "title": "Aplica filtros e envia parâmetros corretos",
              "fullTitle": "Relatórios de Estoque Aplica filtros e envia parâmetros corretos",
              "timedOut": null,
              "duration": 3301,
              "state": "failed",
              "speed": null,
              "pass": false,
              "fail": true,
              "pending": false,
              "context": null,
              "code": "cy.visit('/relatorios/estoque');\ncy.wait('@mov'); // primeira carga\n// Registrar novamente para capturar a próxima requisição com filtros\ncy.intercept('GET', '/api/estoque/movimentos*', req => {\n  req.reply({\n    statusCode: 200,\n    body: {\n      data: [],\n      total: 0,\n      per_page: 20\n    }\n  });\n}).as('mov2');\ncy.get('#f-start').type('2025-10-01');\ncy.get('#f-end').type('2025-10-31');\ncy.get('#f-sku').type('SKU');\ncy.get('#f-tipo').select('Entrada');\ncy.get('#btn-aplicar').click();\n// Validar querystring da última interceptação\ncy.get('@mov2.all').should('have.length.greaterThan', 0).then(intercepts => {\n  const last = intercepts[intercepts.length - 1];\n  const url = new URL(last.request.url);\n  const sp = url.searchParams;\n  expect(sp.get('start')).to.eq('2025-10-01');\n  expect(sp.get('end')).to.eq('2025-10-31');\n  expect(sp.get('q')).to.eq('SKU');\n  expect(sp.get('type')).to.eq('in');\n});\n// Exportação inclui filtros e separador\ncy.get('#f-sep').select(',');\n// Forçar nova carga para atualizar link\ncy.get('#btn-aplicar').click();\ncy.get('#btn-export-mov').invoke('attr', 'href').then(href => {\n  expect(href).to.contain('/api/estoque/movimentos/export.csv?');\n  // separador vírgula deve estar codificado\n  expect(href).to.contain('sep=%2C');\n  expect(href).to.contain('type=in');\n  expect(href).to.contain('q=SKU');\n  expect(href).to.contain('start=2025-10-01');\n  expect(href).to.contain('end=2025-10-31');\n});",
              "err": {
                "message": "AssertionError: expected '30-09-2025' to equal '2025-10-01'",
                "estack": "AssertionError: expected '30-09-2025' to equal '2025-10-01'\n    at Context.eval (webpack://gestoreasy-v3/./cypress/e2e/relatorios_estoque.cy.js:64:33)",
                "diff": "- '30-09-2025'\n+ '2025-10-01'\n"
              },
              "uuid": "9a975d09-ec2b-4dc8-8462-f54826811034",
              "parentUUID": "897d35f1-6516-42aa-a297-a4aabde0d4a2",
              "isHook": false,
              "skipped": false
            },
            {
              "title": "Página e itens por página atualizam page/per_page; botão próximo navega",
              "fullTitle": "Relatórios de Estoque Página e itens por página atualizam page/per_page; botão próximo navega",
              "timedOut": null,
              "duration": 2533,
              "state": "failed",
              "speed": null,
              "pass": false,
              "fail": true,
              "pending": false,
              "context": null,
              "code": "// Stub com total alto para permitir várias páginas\ncy.intercept('GET', '/api/estoque/movimentos*', req => {\n  req.reply({\n    statusCode: 200,\n    body: {\n      data: [],\n      total: 120,\n      per_page: 20\n    }\n  });\n}).as('movPag');\ncy.visit('/relatorios/estoque');\ncy.wait('@movPag');\n// Alterar itens por página para 50 e ir para a próxima página\ncy.get('#mov-per').select('50');\ncy.wait('@movPag');\ncy.get('#mov-next').click();\ncy.wait('@movPag');\ncy.get('@movPag.all').then(intercepts => {\n  const last = intercepts[intercepts.length - 1];\n  const url = new URL(last.request.url);\n  const sp = url.searchParams;\n  expect(sp.get('page')).to.eq('2');\n  expect(sp.get('per_page')).to.eq('50');\n});\ncy.get('#mov-page-label').should('contain.text', 'Página 2');\ncy.get('#mov-next').should('not.be.disabled');",
              "err": {
                "message": "AssertionError: expected '20' to equal '50'",
                "estack": "AssertionError: expected '20' to equal '50'\n    at Context.eval (webpack://gestoreasy-v3/./cypress/e2e/relatorios_estoque.cy.js:105:36)",
                "diff": "- '20'\n+ '50'\n"
              },
              "uuid": "0978323b-c16a-44d2-91e2-0f56c10e39d8",
              "parentUUID": "897d35f1-6516-42aa-a297-a4aabde0d4a2",
              "isHook": false,
              "skipped": false
            },
            {
              "title": "Mostra estado vazio quando API retorna sem movimentos",
              "fullTitle": "Relatórios de Estoque Mostra estado vazio quando API retorna sem movimentos",
              "timedOut": null,
              "duration": 2057,
              "state": "passed",
              "speed": "fast",
              "pass": true,
              "fail": false,
              "pending": false,
              "context": null,
              "code": "cy.intercept('GET', '/api/estoque/movimentos*', req => {\n  req.reply({\n    statusCode: 200,\n    body: {\n      data: [],\n      total: 0,\n      per_page: 20\n    }\n  });\n}).as('movEmpty');\ncy.visit('/relatorios/estoque');\ncy.wait('@movEmpty');\ncy.get('#tbl-movimentos tbody').should('contain.text', 'Nenhum movimento encontrado');",
              "err": {},
              "uuid": "0c58e73b-ebeb-4d4b-ac89-b9390f200dea",
              "parentUUID": "897d35f1-6516-42aa-a297-a4aabde0d4a2",
              "isHook": false,
              "skipped": false
            }
          ],
          "suites": [],
          "passes": [
            "e73d2ced-8f75-48b4-9ad0-ca699bf30e58",
            "0c58e73b-ebeb-4d4b-ac89-b9390f200dea"
          ],
          "failures": [
            "9a975d09-ec2b-4dc8-8462-f54826811034",
            "0978323b-c16a-44d2-91e2-0f56c10e39d8"
          ],
          "pending": [],
          "skipped": [],
          "duration": 10870,
          "root": false,
          "rootEmpty": false,
          "_timeout": 2000
        }
      ],
      "passes": [],
      "failures": [],
      "pending": [],
      "skipped": [],
      "duration": 0,
      "root": true,
      "rootEmpty": true,
      "_timeout": 2000
    }
  ],
  "meta": {
    "mocha": {
      "version": "7.0.1"
    },
    "mochawesome": {
      "options": {
        "quiet": true,
        "reportFilename": "mochawesome",
        "saveHtml": true,
        "saveJson": true,
        "consoleReporter": "spec",
        "useInlineDiffs": false,
        "code": true
      },
      "version": "7.1.4"
    },
    "marge": {
      "options": {
        "id": "default",
        "reportDir": "cypress/reports/mochawesome",
        "overwrite": false,
        "html": true,
        "json": true,
        "quiet": true
      },
      "version": "6.3.2"
    }
  }
}