/* eslint-env mocha */

"use strict";

const request = require("supertest");
const host = require("./helpers").host;

describe("GET /404", function() {
	it("responds with a 404 status", () => {
		return request(host)
			.get("/404")
			.expect(404)
			.expect("Cache-Control", "max-age=30, public, s-maxage=31536000, stale-while-revalidate=604800, stale-if-error=604800")
			.expect("Content-Type", "text/html; charset=utf-8");
	});

	it("responds with a 404 status", () => {
		return request(host)
			.get("/pages/fixedData/")
			.expect(404)
			.expect("Cache-Control", "max-age=30, public, s-maxage=31536000, stale-while-revalidate=604800, stale-if-error=604800")
			.expect("Content-Type", "text/html; charset=utf-8");
	});

	it("responds with a 404 status", () => {
		return request(host)
			.get("/https://polyfill.io/")
			.expect(404)
			.expect("Cache-Control", "max-age=30, public, s-maxage=31536000, stale-while-revalidate=604800, stale-if-error=604800")
			.expect("Content-Type", "text/html; charset=utf-8");
	});

	it("responds with a 404 status", () => {
		return request(host)
			.get("/https://cdn.polyfill.io/")
			.expect(404)
			.expect("Cache-Control", "max-age=30, public, s-maxage=31536000, stale-while-revalidate=604800, stale-if-error=604800")
			.expect("Content-Type", "text/html; charset=utf-8");
	});
});

@@ -540,787 +540,253 @@
 404)
-%0A%09%09%09.expect(%22Cache-Control%22, %22max-age=30, public, s-maxage=31536000, stale-while-revalidate=604800, stale-if-error=604800%22)%0A%09%09%09.expect(%22Content-Type%22, %22text/html; charset=utf-8%22);%0A%09%7D);%0A%0A%09it(%22responds with a 404 status%22, () =%3E %7B%0A%09%09return request(host)%0A%09%09%09.get(%22/https://polyfill.io/%22)%0A%09%09%09.expect(404)%0A%09%09%09.expect(%22Cache-Control%22, %22max-age=30, public, s-maxage=31536000, stale-while-revalidate=604800, stale-if-error=604800%22)%0A%09%09%09.expect(%22Content-Type%22, %22text/html; charset=utf-8%22);%0A%09%7D);%0A%0A%09it(%22responds with a 404 status%22, () =%3E %7B%0A%09%09return request(host)%0A%09%09%09.get(%22/https://cdn.polyfill.io/%22)%0A%09%09%09.expect(404)%0A%09%09%09.expect(%22Cache-Control%22, %22max-age=30, public, s-maxage=31536000, stale-while-revalidate=604800, stale-if-error=604800%22)%0A%09%09%09.expect(%22Content-Type%22, %22text/html; charset=utf-8%22
+;%0A%09%7D);%0A%0A%09it(%22responds with a 404 status%22, () =%3E %7B%0A%09%09return request(host)%0A%09%09%09.get(%22/https://polyfill.io/%22)%0A%09%09%09.expect(404);%0A%09%7D);%0A%0A%09it(%22responds with a 404 status%22, () =%3E %7B%0A%09%09return request(host)%0A%09%09%09.get(%22/https://cdn.polyfill.io/%22)%0A%09%09%09.expect(404
 );%0A%09

update 404 tests for synthetic responses to not include cache-control header or html content-type