mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-12-11 01:19:32 +00:00
Release 2.33.0 (#3903)
This commit is contained in:
committed by
GitHub
parent
62b0f7f26e
commit
b0c5924019
@@ -1,4 +1,4 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
||||
|
||||
exports[`Updatenotification custom module returns status information without hash 1`] = `
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
const { cors } = require("../../../js/server_functions");
|
||||
const { expect } = require("playwright/test");
|
||||
const { cors, getUserAgent } = require("#server_functions");
|
||||
|
||||
describe("server_functions tests", () => {
|
||||
describe("The cors method", () => {
|
||||
@@ -142,5 +143,21 @@ describe("server_functions tests", () => {
|
||||
expect(corsResponse.set.mock.calls[2][0]).toBe("header2");
|
||||
expect(corsResponse.set.mock.calls[2][1]).toBe("value2");
|
||||
});
|
||||
|
||||
it("Gets User-Agent from configuration", async () => {
|
||||
config = {};
|
||||
let userAgent;
|
||||
|
||||
userAgent = getUserAgent();
|
||||
expect(userAgent).toContain("Mozilla/5.0 (Node.js ");
|
||||
|
||||
config.userAgent = "Mozilla/5.0 (Foo)";
|
||||
userAgent = getUserAgent();
|
||||
expect(userAgent).toBe("Mozilla/5.0 (Foo)");
|
||||
|
||||
config.userAgent = () => "Mozilla/5.0 (Bar)";
|
||||
userAgent = getUserAgent();
|
||||
expect(userAgent).toBe("Mozilla/5.0 (Bar)");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user