@@ -62,10 +62,10 @@ class Counter extends React.Component {
6262 this .handleClick = this .handleClick .bind (this );
6363 }
6464 componentDidMount () {
65- document .title = ` You clicked ${ this .state .count } times ` ;
65+ document .title = ` Bạn click ${ this .state .count } lần ` ;
6666 }
6767 componentDidUpdate () {
68- document .title = ` You clicked ${ this .state .count } times ` ;
68+ document .title = ` Bạn click ${ this .state .count } lần ` ;
6969 }
7070 handleClick () {
7171 this .setState (state => ({
@@ -105,22 +105,22 @@ afterEach(() => {
105105 container = null;
106106});
107107
108- it('can render and update a counter', () => {
108+ it('có thể render và cập nhật counter', () => {
109109 // Test first render and componentDidMount
110110 act(() => {
111111 ReactDOM.render(<Counter />, container);
112112 });
113- const button = container.querySelector('button ');
113+ const button = container.querySelector('nút bấm ');
114114 const label = container.querySelector('p');
115- expect(label.textContent).toBe('You clicked 0 times ');
116- expect(document.title).toBe('You clicked 0 times ');
115+ expect(label.textContent).toBe('Bạn click 0 lần ');
116+ expect(document.title).toBe('Bạn click 0 lần ');
117117
118118 // Test second render and componentDidUpdate
119119 act(() => {
120120 button.dispatchEvent(new MouseEvent('click', {bubbles: true}));
121121 });
122- expect(label.textContent).toBe('You clicked 1 times ');
123- expect(document.title).toBe('You clicked 1 times ');
122+ expect(label.textContent).toBe('Bạn click 1 lần ');
123+ expect(document.title).toBe('Bạn click 1 lần ');
124124});
125125```
126126
0 commit comments