Better testing of drawingCanvas component
continuous-integration/drone/push Build is passing Details

master
Arthur VALIN 2 years ago
parent 2033337790
commit ff42c808c2

@ -4,7 +4,8 @@ import { configureStore } from "@reduxjs/toolkit";
import { render, screen} from '@testing-library/react-native'
import testReducer from "./testReducer";
import KanjiPlaygroundList from "../components/KanjiPlaygroundList";
import {expect} from '@jest/globals';
import '@testing-library/jest-native/extend-expect';
jest.useFakeTimers();
@ -32,5 +33,8 @@ describe('<KanjiPlaygroundList/>', () => {
</Wrapper>)
expect(screen.queryAllByTestId("kanji-list-item")).toHaveLength(expectedList.length);
expectedList.forEach( (value, index) => {
expect(screen.queryAllByTestId("kanji-list-item")[index]).toHaveTextContent(value.character)
})
})
});

@ -10,15 +10,10 @@ const initialState = {
new Kanji("訪", "visit", "", "", 11, "ホウ", "おとずれる", { character: "", position: "" }, [{
english: "visit", japanese: "訪ねる(たずねる)"
}]),
new Kanji("訪", "visit", "", "", 11, "ホウ", "おとずれる", { character: "", position: "" }, [{
english: "visit", japanese: "訪ねる(たずねる)"
}]),
new Kanji("訪", "visit", "", "", 11, "ホウ", "おとずれる", { character: "", position: "" }, [{
english: "visit", japanese: "訪ねる(たずねる)"
}]),
new Kanji("雨", "rain", "", "", 8, "ウ", "あめ、あま", { character: "", position: "" }, []),
]
}
export default testReducer = (state = initialState, action) => {
export default (state = initialState, action) => {
return kanjiReducer(initialState, action);
}
Loading…
Cancel
Save