callstack / react-native-testing-library

🦉 Simple and complete React Native testing utilities that encourage good testing practices.
https://callstack.github.io/react-native-testing-library/
MIT License
3.02k stars 264 forks source link

snapshot name not applied to the snap file #1553

Closed kheang24 closed 6 months ago

kheang24 commented 6 months ago

Describe the bug

Snapshot name not applied to the snap file

Expected behavior

Expected the snapshot name to be applied in the snap file

Steps to Reproduce

//App.test.tsx
import { render, screen } from "@testing-library/react-native";
import React from "react";

import App from "./App";

describe("<App />", () => {
  it("render correctly", () => {});
  render(<App />);
  expect(screen).toMatchSnapshot("customSnapshotName");
});
//App.test.tsx.snap
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[` 1`] = `
<View
  style={
    {
      "alignItems": "center",
      "backgroundColor": "#fff",
      "flex": 1,
      "justifyContent": "center",
    }
  }
>

Screenshots

Versions

npmPackages: @testing-library/react-native: ^12.4.3 => 12.4.3 react: 18.2.0 => 18.2.0 react-native: 0.72.6 => 0.72.6 react-test-renderer: 18.2.0 => 18.2.0