Fix unit tests assuming ignored files were not displayed

This commit is contained in:
Antonio Scandurra 2022-05-24 10:50:27 +02:00
parent ec88288d5e
commit 99573ca270

View file

@ -972,6 +972,7 @@ mod tests {
visible_entries_as_strings(&panel, 0..50, cx), visible_entries_as_strings(&panel, 0..50, cx),
&[ &[
"v root1", "v root1",
" > .git",
" > a", " > a",
" > b", " > b",
" > C", " > C",
@ -987,6 +988,7 @@ mod tests {
visible_entries_as_strings(&panel, 0..50, cx), visible_entries_as_strings(&panel, 0..50, cx),
&[ &[
"v root1", "v root1",
" > .git",
" > a", " > a",
" v b <== selected", " v b <== selected",
" > 3", " > 3",
@ -1000,7 +1002,7 @@ mod tests {
); );
assert_eq!( assert_eq!(
visible_entries_as_strings(&panel, 5..8, cx), visible_entries_as_strings(&panel, 6..9, cx),
&[ &[
// //
" > C", " > C",
@ -1064,6 +1066,7 @@ mod tests {
visible_entries_as_strings(&panel, 0..10, cx), visible_entries_as_strings(&panel, 0..10, cx),
&[ &[
"v root1 <== selected", "v root1 <== selected",
" > .git",
" > a", " > a",
" > b", " > b",
" > C", " > C",
@ -1082,6 +1085,7 @@ mod tests {
visible_entries_as_strings(&panel, 0..10, cx), visible_entries_as_strings(&panel, 0..10, cx),
&[ &[
"v root1", "v root1",
" > .git",
" > a", " > a",
" > b", " > b",
" > C", " > C",
@ -1103,6 +1107,7 @@ mod tests {
visible_entries_as_strings(&panel, 0..10, cx), visible_entries_as_strings(&panel, 0..10, cx),
&[ &[
"v root1", "v root1",
" > .git",
" > a", " > a",
" > b", " > b",
" > C", " > C",
@ -1119,6 +1124,7 @@ mod tests {
visible_entries_as_strings(&panel, 0..10, cx), visible_entries_as_strings(&panel, 0..10, cx),
&[ &[
"v root1", "v root1",
" > .git",
" > a", " > a",
" > b", " > b",
" > C", " > C",
@ -1133,9 +1139,10 @@ mod tests {
select_path(&panel, "root1/b", cx); select_path(&panel, "root1/b", cx);
panel.update(cx, |panel, cx| panel.add_file(&AddFile, cx)); panel.update(cx, |panel, cx| panel.add_file(&AddFile, cx));
assert_eq!( assert_eq!(
visible_entries_as_strings(&panel, 0..9, cx), visible_entries_as_strings(&panel, 0..10, cx),
&[ &[
"v root1", "v root1",
" > .git",
" > a", " > a",
" v b", " v b",
" > 3", " > 3",
@ -1157,9 +1164,10 @@ mod tests {
.await .await
.unwrap(); .unwrap();
assert_eq!( assert_eq!(
visible_entries_as_strings(&panel, 0..9, cx), visible_entries_as_strings(&panel, 0..10, cx),
&[ &[
"v root1", "v root1",
" > .git",
" > a", " > a",
" v b", " v b",
" > 3", " > 3",
@ -1174,9 +1182,10 @@ mod tests {
select_path(&panel, "root1/b/another-filename", cx); select_path(&panel, "root1/b/another-filename", cx);
panel.update(cx, |panel, cx| panel.rename(&Rename, cx)); panel.update(cx, |panel, cx| panel.rename(&Rename, cx));
assert_eq!( assert_eq!(
visible_entries_as_strings(&panel, 0..9, cx), visible_entries_as_strings(&panel, 0..10, cx),
&[ &[
"v root1", "v root1",
" > .git",
" > a", " > a",
" v b", " v b",
" > 3", " > 3",
@ -1195,9 +1204,10 @@ mod tests {
panel.confirm(&Confirm, cx).unwrap() panel.confirm(&Confirm, cx).unwrap()
}); });
assert_eq!( assert_eq!(
visible_entries_as_strings(&panel, 0..9, cx), visible_entries_as_strings(&panel, 0..10, cx),
&[ &[
"v root1", "v root1",
" > .git",
" > a", " > a",
" v b", " v b",
" > 3", " > 3",
@ -1211,9 +1221,10 @@ mod tests {
confirm.await.unwrap(); confirm.await.unwrap();
assert_eq!( assert_eq!(
visible_entries_as_strings(&panel, 0..9, cx), visible_entries_as_strings(&panel, 0..10, cx),
&[ &[
"v root1", "v root1",
" > .git",
" > a", " > a",
" v b", " v b",
" > 3", " > 3",
@ -1227,9 +1238,10 @@ mod tests {
panel.update(cx, |panel, cx| panel.add_directory(&AddDirectory, cx)); panel.update(cx, |panel, cx| panel.add_directory(&AddDirectory, cx));
assert_eq!( assert_eq!(
visible_entries_as_strings(&panel, 0..9, cx), visible_entries_as_strings(&panel, 0..10, cx),
&[ &[
"v root1", "v root1",
" > .git",
" > a", " > a",
" v b", " v b",
" > [EDITOR: ''] <== selected", " > [EDITOR: ''] <== selected",
@ -1249,9 +1261,10 @@ mod tests {
}); });
panel.update(cx, |panel, cx| panel.select_next(&Default::default(), cx)); panel.update(cx, |panel, cx| panel.select_next(&Default::default(), cx));
assert_eq!( assert_eq!(
visible_entries_as_strings(&panel, 0..9, cx), visible_entries_as_strings(&panel, 0..10, cx),
&[ &[
"v root1", "v root1",
" > .git",
" > a", " > a",
" v b", " v b",
" > [PROCESSING: 'new-dir']", " > [PROCESSING: 'new-dir']",
@ -1265,9 +1278,10 @@ mod tests {
confirm.await.unwrap(); confirm.await.unwrap();
assert_eq!( assert_eq!(
visible_entries_as_strings(&panel, 0..9, cx), visible_entries_as_strings(&panel, 0..10, cx),
&[ &[
"v root1", "v root1",
" > .git",
" > a", " > a",
" v b", " v b",
" > 3 <== selected", " > 3 <== selected",