English 中文(简体)
Why LD SDK Jest Test MockFlags Returning Undefined
原标题:

So I have a component that checks a flag and based on if the flag returns true or false, we do something with it. The issue I have is when I am mocking according to LD documentation, the flag is coming back as undefined instead of true or false. Not sure what I am doing wrong here

test( username should not be clickable when flag is on , async () => {
  // ARRANGE
  mockFlags({
    myProfile: true,
  });

  render(<ClientInfo reservation={reservation} />);

  // ASSERT
  const userName = screen.getByText( Test Test );

  expect(userName).toHaveAttribute( href , profileLink);
});

In the component when I console log the flag, I see undefined. Not sure what I am doing wrong in my react app that is causing this. Any ideas?

问题回答

暂无回答




相关问题
How to use one react app into another react app?

I have two react apps, parent app and child app. and child app have an hash router. I have build the child app using npm run build, It creates build folder. That build folder moved into inside the ...

how to get selected value in Ant Design

I want to print the selected value, and below is my option list: const vesselName = [ { value: 0 , label: ALBIDDA , }, { value: 1 , label: ALRUMEILA , }, { value: 2 ,...

How to add a <br> tag in reactjs between two strings?

I am using react. I want to add a line break <br> between strings No results and Please try another search term. . I have tried No results.<br>Please try another search term. but ...

热门标签