Skip to content

Commit

Permalink
Merge pull request #2747 from digitalfabrik/deps/upgrade_webauthn_tes…
Browse files Browse the repository at this point in the history
…t_support

deps/upgrade webauthn test support
  • Loading branch information
Dennis Dierkes authored Apr 22, 2024
2 parents 352767a + 184f1aa commit cb82c06
Show file tree
Hide file tree
Showing 6 changed files with 1,330 additions and 9 deletions.
14 changes: 14 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,17 @@ jobs:
- run:
name: Check formatting of CSS & JS files
command: npx prettier --check .
vitest:
docker:
- image: "cimg/node:lts"
resource_class: small
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Run frontend tests
command: npm run test
eslint:
docker:
- image: "cimg/node:lts"
Expand Down Expand Up @@ -593,6 +604,9 @@ workflows:
- prettier:
requires:
- npm-install
- vitest:
requires:
- npm-install
- webpack:
requires:
- npm-install
Expand Down
17 changes: 17 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
const path = require("path");

module.exports = {
env: {
es6: true,
browser: true,
},
settings: {
"import/resolver": {
node: {
paths: ["src"],
extensions: [".js", ".jsx", ".ts", ".d.ts", ".tsx"],
},
typescript: {
project: "./tsconfig.json",
},
alias: {
map: [["~", path.resolve(__dirname, "./src")]],
extensions: [".js", ".jsx", ".ts", ".d.ts", ".tsx"],
},
},
},
ignorePatterns: [
"**/dist/",
"**/htmlcov/**",
Expand Down
9 changes: 9 additions & 0 deletions integreat_cms/static/src/js/__tests__/utils/mfa-utils.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { expect, test } from "vitest";
import { b64enc } from "../../utils/mfa-utils";

test("base64 and url encoding", () => {
const testDataString = "https://example.com/?q=Hello+World!";
const testData = new TextEncoder().encode(testDataString);

expect(b64enc(testData)).toBe("aHR0cHM6Ly9leGFtcGxlLmNvbS8_cT1IZWxsbytXb3JsZCE");
});
Loading

0 comments on commit cb82c06

Please sign in to comment.