Fix pageAdmin setPrevioiusPageUsingActivePage writing to wrong property

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 08:08:00 +08:00
parent eac33d4888
commit 2141f514c5
2 changed files with 3 additions and 5 deletions

View File

@@ -47,7 +47,7 @@ export default defineStore('pageAdminStore', {
* Set the previous(usually current) pages to the ones we just decide. * Set the previous(usually current) pages to the ones we just decide.
*/ */
setPrevioiusPageUsingActivePage() { setPrevioiusPageUsingActivePage() {
this.previoiusPage = this.activePage; this.previousPage = this.activePage;
}, },
/** /**
* Set the boolean value of status of pending state of the pate * Set the boolean value of status of pending state of the pate

View File

@@ -29,12 +29,10 @@ describe('pageAdminStore', () => {
expect(store.previousPage).toBe('PERFORMANCE'); expect(store.previousPage).toBe('PERFORMANCE');
}); });
it('setPrevioiusPageUsingActivePage copies activePage', () => { it('setPrevioiusPageUsingActivePage copies activePage to previousPage', () => {
store.setActivePage('CONFORMANCE'); store.setActivePage('CONFORMANCE');
store.setPrevioiusPageUsingActivePage(); store.setPrevioiusPageUsingActivePage();
// Note: bug in source - writes to this.previoiusPage (typo) expect(store.previousPage).toBe('CONFORMANCE');
// instead of this.previousPage, so previousPage stays 'MAP'
expect(store.previousPage).toBe('MAP');
}); });
it('setIsPagePendingBoolean sets boolean', () => { it('setIsPagePendingBoolean sets boolean', () => {