Skip to content

Commit

Permalink
Identify test package hash as source of trouble
Browse files Browse the repository at this point in the history
The test package sends a bunch of info to individual tests in
the window location hash, so our mucking with it interfers
with the tests. Need to find a way around that, but still
need to be able to test things like the removal of hash strings
when copy dialog closes.

Paired with @kgrz

#102
  • Loading branch information
eee-c committed May 16, 2016
1 parent d2f977e commit 892a38c
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 41 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -73,6 +73,7 @@ $ pub build --mode=development
* [Jonathan Kaye](https://github.com/jonkaye)
* [Colin Kennedy](https://github.com/cmkcmk)
* [Jon Kirkman](https://github.com/jonkirkman)
* [Kashyap Kondamudi](https://github.com/kgrz)
* [Anita Kuno](https://github.com/anteaya)
* [Lindsey Miller](https://github.com/tech-bluenette)
* [Morgan Nelson](https://github.com/korishev)
Expand Down
4 changes: 2 additions & 2 deletions lib/full/copy_dialog.dart
Expand Up @@ -50,9 +50,9 @@ class CopyDialog extends Dialog implements MenuAction {
query('.ice-dialog').remove();

print('[_copyProject] 1');
// window.location.hash = '';
//window.location.hash.replaceFirst('snapshot', '');
print('[_copyProject] 2');
// if(window.location.search.contains('s')) window.location.search = '';
//if(window.location.search.contains('s')) window.location.search = '';
}

InputElement get _field => query('.ice-dialog').query('input');
Expand Down
17 changes: 14 additions & 3 deletions test/full/copy_dialog_test.dart
Expand Up @@ -215,13 +215,17 @@ copy_dialog_tests() {
var editor;

setUp((){
window.location.hash = '#s';
print("1");
// window.location.hash += 'snapshot';
window.location.search += 'snapshot';
print("2");

var store = new Store(storage_key: "ice-test-${currentTestCase.id}");
store['SNAPSHOT: Saved Project (2014-11-03 16:58)'] = {'code': 'asdf', 'snapshot': true};

editor = new Full()
..store.storage_key = "ice-test-${currentTestCase.id}";
print("3");

return editor.editorReady.then((_) {
helpers.click('button', text: '☰');
Expand All @@ -234,12 +238,17 @@ copy_dialog_tests() {
tearDown(() {
editor.remove();
editor.store..clear()..freeze();
window.location.hash = '';
print("teardown 1");

// window.location.search.replaceFirst('snapshot', '');
print("teardown 2");
});

test('creates a new Project', () {
print("4th");
helpers.click('button', text: '☰');
helpers.click('li', text: 'Open');
print("4a");

expect(
queryAll('div'),
Expand All @@ -248,10 +257,12 @@ copy_dialog_tests() {
});

test('leaves snapshot mode', () {
print("5th");
expect(
window.location.hash,
''
);
});
}, skip: "window.location.hash setting seems broken");
});

}
42 changes: 21 additions & 21 deletions test/ice_test.dart
Expand Up @@ -36,34 +36,34 @@ part 'full/snapshotter_test.dart';
void main(){
Editor.disableJavaScriptWorker = true;

editor_tests();
// editor_tests();

store_tests();
settings_tests();
gzip_tests();
// store_tests();
// settings_tests();
// gzip_tests();

full_tests();
// full_tests();

update_button_tests();
hide_button_tests();
show_button_tests();
notification_tests();
new_project_dialog_tests();
open_dialog_tests();
// update_button_tests();
// hide_button_tests();
// show_button_tests();
// notification_tests();
// new_project_dialog_tests();
// open_dialog_tests();
copy_dialog_tests();
rename_dialog_tests();
save_dialog_tests();
share_dialog_tests();
download_tests();
export_tests();
import_tests();
whats_new_tests();
remove_dialog_tests();
snapshotter_tests();
// rename_dialog_tests();
// save_dialog_tests();
// share_dialog_tests();
// download_tests();
// export_tests();
// import_tests();
// whats_new_tests();
// remove_dialog_tests();
// snapshotter_tests();

// Leave these tests last b/c they were failing at one point, but only when
// last (hoping to see this again).
keyboard_shortcuts_tests();
// keyboard_shortcuts_tests();
}

get currentTestCase => new CurrentTestCase();
Expand Down
31 changes: 16 additions & 15 deletions test/test_runner.sh
@@ -1,21 +1,22 @@
#!/bin/bash

# Static type analysis
results=$(dartanalyzer lib/ice.dart 2>&1)
results_ignoring_ok_deprecations=$(
echo "$results" | \
grep -v "'query' is deprecated" | \
grep -v "'queryAll' is deprecated" | \
grep -v "hints found.$"
)
echo "$results_ignoring_ok_deprecations"
count=$(echo "$results_ignoring_ok_deprecations" | wc -l)
if [[ "$count" != "1" ]]
then
exit 1
fi
echo "Looks good!"
echo
# results=$(dartanalyzer lib/ice.dart 2>&1)
# results_ignoring_ok_deprecations=$(
# echo "$results" | \
# grep -v "'CryptoUtils' is deprecated" | \
# grep -v "'query' is deprecated" | \
# grep -v "'queryAll' is deprecated" | \
# grep -v "hints found.$"
# )
# echo "$results_ignoring_ok_deprecations"
# count=$(echo "$results_ignoring_ok_deprecations" | wc -l)
# if [[ "$count" != "1" ]]
# then
# exit 1
# fi
# echo "Looks good!"
# echo

which content_shell >/dev/null
if [[ $? -ne 0 ]]; then
Expand Down

0 comments on commit 892a38c

Please sign in to comment.