Commit 97ccbb4
committed
test: update refreshText assertions for new undo-preserving behavior
Editor._resetText now uses cm.replaceRange instead of
cm.setValue + cm.clearHistory so external content reloads (Revert,
FileSyncManager, AI hook flow) leave the undo stack intact and the
user can ctrl-z back to their pre-reset content.
Update the two affected assertions in Document-integ-test.js:
- 'should clear dirty flag AND undo when text reset' renamed to
'should clear dirty flag but preserve undo history when text reset';
expects undo size 2 (original Foo edit + refreshText replaceRange)
instead of 0.
- The clean-text-reset case now expects undo size 1 (the single
replaceRange the new code performs) instead of 0.
The third pre-existing same-text and same-text-different-line-endings
tests already expect history NOT to be cleared (because _resetText
short-circuits when content matches), so they still pass unchanged.1 parent 44bd5b5 commit 97ccbb4
1 file changed
Lines changed: 11 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
141 | 144 | | |
142 | 145 | | |
143 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
144 | 149 | | |
145 | 150 | | |
146 | 151 | | |
| |||
165 | 170 | | |
166 | 171 | | |
167 | 172 | | |
168 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
169 | 176 | | |
170 | 177 | | |
171 | 178 | | |
| |||
0 commit comments