mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-04-24 22:57:12 -04:00
feat: add test for appflowy_editor attributes (#1931)
This commit is contained in:
parent
d3ee346cb7
commit
675c833f07
1 changed files with 31 additions and 0 deletions
|
@ -54,6 +54,37 @@ void main() async {
|
||||||
'b': 3,
|
'b': 3,
|
||||||
'c': 4,
|
'c': 4,
|
||||||
});
|
});
|
||||||
|
expect(invertAttributes(null, base), {
|
||||||
|
'a': null,
|
||||||
|
'b': null,
|
||||||
|
});
|
||||||
|
expect(invertAttributes(other, null), {
|
||||||
|
'b': 3,
|
||||||
|
'c': 4,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
test(
|
||||||
|
"hasAttributes",
|
||||||
|
() {
|
||||||
|
final base = {
|
||||||
|
'a': 1,
|
||||||
|
'b': 2,
|
||||||
|
};
|
||||||
|
final other = {
|
||||||
|
'c': 3,
|
||||||
|
'd': 4,
|
||||||
|
};
|
||||||
|
|
||||||
|
var x = hashAttributes(base);
|
||||||
|
var y = hashAttributes(base);
|
||||||
|
// x & y should have same hash code
|
||||||
|
expect(x == y, true);
|
||||||
|
|
||||||
|
y = hashAttributes(other);
|
||||||
|
|
||||||
|
// x & y should have different hash code
|
||||||
|
expect(x == y, false);
|
||||||
|
},
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue