1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3274],{14893:(e,t,o)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/_error.spec",function(){return o(78214)}])},78214:(e,t,o)=>{"use strict";o.r(t);var n=o(6506),r=o(33506),s=o(2805),i=o(81637),a=o(86738),d=o(82111);vi.mock("next/head",()=>({__esModule:!0,default:({children:e})=>(0,n.jsx)(r.Fragment,{children:e})}));let l=(e,t)=>{(0,s.XX)((0,n.jsx)(i.A,{theme:"peacock",environment:"dev",children:(0,n.jsx)(d.default,{statusCode:e,propositionName:t,__APPLICATION_CONFIG__:{themeId:"peacock"}})}))},c=(e,t=500)=>({res:{statusCode:t,headersSent:!1,setHeader:vi.fn(),locals:e}});describe("Error",()=>{it("renders the branded error page for server errors",()=>{l(500),expect(s.nj.getByRole("heading",{name:a.S7.title})).toBeInTheDocument(),expect(s.nj.getByRole("link",{name:a.S7.ctaLabel})).toHaveAttribute("href","/")}),it("renders the copy for the proposition that was being served",()=>{let e=(0,a.Ji)("NOWITALY");l(500,"NOWITALY"),expect(s.nj.getByRole("heading",{name:e.title})).toBeInTheDocument(),expect(s.nj.getByText(e.description)).toBeInTheDocument(),expect(document.querySelector("title")).toHaveTextContent(e.documentTitle)}),it("falls back to the built in error page below 500",()=>{l(404),expect(s.nj.queryByRole("heading",{name:a.S7.title})).not.toBeInTheDocument(),expect(s.nj.getByText(/404/)).toBeInTheDocument()}),describe("getInitialProps",()=>{it("resolves the theme from the proposition and stops the response being cached",()=>{let e=c({propositionName:"NOWITALY"});expect(d.default.getInitialProps?.(e)).toEqual({statusCode:500,propositionName:"NOWITALY",__APPLICATION_CONFIG__:{themeId:"nowit"}}),expect(e.res?.setHeader).toHaveBeenCalledWith("Cache-Control","no-store")}),it("keeps the response status code and defaults the theme for an unknown proposition",()=>{expect(d.default.getInitialProps?.(c({},404))).toEqual({statusCode:404,propositionName:void 0,__APPLICATION_CONFIG__:{themeId:"peacock"}})})})})},82111:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>C});var n=o(6506),r=o(33506),s=o(28586),i=o.n(s),a=o(40498),d=o.n(a),l=o(10374),c=o(41272),p=o(86738);let h={NBCU:l.C.PEACOCK,SKYSHOWTIME:l.C.SKYSHOWTIME,NOWGB:l.C.NOW,NOWIE:l.C.NOW,NOWITALY:l.C.NOWIT,WOW:l.C.WOW,WOWAT:l.C.WOW},u=({statusCode:e,propositionName:t})=>e<500?(0,n.jsx)(d(),{statusCode:e}):(0,n.jsxs)(r.Fragment,{children:[(0,n.jsxs)(i(),{children:[(0,n.jsx)("title",{children:(0,p.Ji)(t).documentTitle}),(0,n.jsx)("meta",{name:"robots",content:"noindex"})]}),(0,n.jsx)(c.A,{propositionName:t})]});u.getInitialProps=({res:e,err:t})=>{let o=e?.statusCode??t?.statusCode??500,n=e?.locals?.propositionName;return e&&!e.headersSent&&e.setHeader("Cache-Control","no-store"),{statusCode:o,propositionName:n,__APPLICATION_CONFIG__:{themeId:n&&h[n]||l.C.PEACOCK}}};let C=u}},e=>{e.O(0,[6593,8096,5851,7883,9011,3825,3643,636,8792],()=>e(e.s=14893)),_N_E=e.O()}]); 2//# sourceMappingURL=_error.spec-491c372df8209efd.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.