skip to Main Content

How to get filename of the rendered font CSS?

Is it possible to get the filename of the rendered font of an element? Example: @font-face { font-family: 'MyFont'; src: url('../../public/fonts/MyFont-Bold.woff2') format('woff2'); font-weight: bold; font-style: normal; } @font-face { font-family: 'MyFont'; src: url('../../public/fonts/MyFont-Italic.woff2') format('woff2'); font-weight: normal; font-style: italic; } .my-font-bold…

VIEW QUESTION

Javascript – Load .js function in jest as script

I have a project that I think its time to write tests for. In this project I load in external functions that look like this in the html: <script src="library/VoiceRecordingHelper.js"></script> The .js looks like this: async function uploadVoiceRecordingToBucket(data, ticketId, cloudProvider)…

VIEW QUESTION

Reactjs – How to resolve 'Element type is invalid' error when testing a React component using @mui/icons-material?

I'm facing an issue that I can't figure out how to resolve. i'm trying to test this component: import LabelIconButton from '../LabelIconButton' import { PowerSettingsNew } from '@mui/icons-material' export default function LabelIconButtonDisconnection() { return <LabelIconButton title="déconnexion" icon={PowerSettingsNew} /> } With…

VIEW QUESTION

How to mock a MongoDB query .exec() in Jest?

I would like to mock this async function with Jest in a Typescript Express env. // src/helpers/user.ts import { UserModel } from "../models"; export const getUserByUsername = async (username: string) => { return UserModel.findOne({ username }).exec() } // src/models/index.ts import…

VIEW QUESTION
Back To Top
Search