<commit_before>import 'package:over_react_test/over_react_test.dart';
import 'package:test/test.dart';
import 'dart:async';
// import 'package:http/testing.dart';
import 'dart:convert';
import '../../features.dart';

void main() {
  group("Top Nav Tests", () {
    test('Should render top_nav component', () {
      var instance = render(AppContainer()());
      AppContainerComponent component = getDartComponent(instance);
      var renderedComponent = findDomNode(component);

      expect(renderedComponent.querySelector('div > div > h1').text, 'Hamster');
    });
  });

  group("PlaceDetails Tests", () {
    test('Should render place details', () {
      var instance = render(AppContainer()());
      AppContainerComponent component = getDartComponent(instance);
      
      var renderedComponent = findDomNode(component);

      expect(renderedComponent.querySelector('h2').text, "Loading");

    });

    test('Should change state when update place details is called', () {
      var instance = render(AppContainer()());
      AppContainerComponent component = getDartComponent(instance);

      component.getPlaceDetails().then((_) {
        expect(component.state.name.isNotEmpty, true);
        expect(component.state.imageUrl.isNotEmpty, true);
        expect(component.state.foodType.isNotEmpty, true);
        expect(component.state.price.isNaN, false);
        expect(component.state.rating.isNaN, false);
        expect(component.state.distance.isNaN, false);
      });
    });
  });
}<commit_msg>fixes async problems with tests<commit_after>import 'package:over_react_test/over_react_test.dart';
import 'package:test/test.dart';
import 'dart:async';
// import 'package:http/testing.dart';
import 'dart:convert';
import '../../features.dart';

void main() {
  group("Top Nav Tests", () {
    test('Should render top_nav component', () {
      var instance = render(AppContainer()());
      AppContainerComponent component = getDartComponent(instance);
      var renderedComponent = findDomNode(component);

      expect(renderedComponent.querySelector('div > div > h1').text, 'Hamster');
    });
  });

  group("PlaceDetails Tests", () {
    test('Should render place details', () {
      var instance = render(AppContainer()());
      AppContainerComponent component = getDartComponent(instance);
      
      var renderedComponent = findDomNode(component);

      expect(renderedComponent.querySelector('h2').text, "Loading");

    });

    test('Should change state when update place details is called', ()  async {
      var instance = render(AppContainer()());
      AppContainerComponent component = getDartComponent(instance);

      await component.getPlaceDetails();

      expect(component.state.name.isNotEmpty, true);
      expect(component.state.imageUrl.isNotEmpty, true);
      expect(component.state.foodType.isNotEmpty, true);
      expect(component.state.price.isNaN, false);
      expect(component.state.rating.isNaN, false);
      expect(component.state.distance.isNaN, false);
    });
  });
}
{'fraction_non_alphanumeric': 0.14149076517150397, 'fraction_numerical': 0.0013192612137203166, 'mean_word_length': 3.939739413680782, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6198625', 'n_tokens_mistral': 839, 'n_tokens_neox': 825, 'n_words': 164}