Merge pull request #1352 from dermotduffy/seek-merge

Fix minor seeking issue in unreleased code
This commit is contained in:
Dermot Duffy
2024-01-27 18:03:49 -08:00
committed by GitHub
3 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -178,7 +178,7 @@ export class View {
* @returns This view.
*/
public mergeInContext(context?: ViewContext): View {
this.context = merge(this.context ?? {}, this.context, context);
this.context = merge({}, this.context, context);
return this;
}
+6
View File
@@ -113,6 +113,12 @@ describe('View Basics', () => {
view.mergeInContext({ timeline: timelineContext });
expect(view.context?.live).toEqual(liveContext);
expect(view.context?.timeline).toEqual(timelineContext);
// Verify that merging context creates a new context object, as some
// downstream users may check for context equality.
const oldContext = view.context;
view.mergeInContext({ live: liveContext });
expect(view.context).not.toBe(oldContext);
});
it('should remove context', () => {
+1 -1
View File
@@ -11,7 +11,7 @@ export default defineConfig({
// back-sliding.
thresholdAutoUpdate: true,
statements: 71.95,
branches: 60.8,
branches: 60.78,
functions: 73.04,
lines: 71.84,
},