From 866c82647a342afea8187723bf6a2cf69f788a4c Mon Sep 17 00:00:00 2001 From: Ilya Khait Date: Thu, 12 Oct 2023 19:28:35 +0000 Subject: [PATCH] Implement Gregorian string output, correct, update & refactor --- src/chronology/domain/Date.test.ts | 16 +- src/chronology/domain/Date.ts | 11 +- src/chronology/domain/DateConverter.test.ts | 28 ++- src/chronology/domain/DateConverter.ts | 50 +++-- src/chronology/domain/DateConverterBase.ts | 195 +++++++----------- src/chronology/domain/dateConverterData.json | 18 -- src/chronology/ui/DateConverterForm.tsx | 24 +-- .../ui/DatesInTextSelection.test.tsx | 4 +- .../FragmentariumSearch.test.tsx.snap | 4 +- 9 files changed, 165 insertions(+), 185 deletions(-) diff --git a/src/chronology/domain/Date.test.ts b/src/chronology/domain/Date.test.ts index 924ffec31..be6e0186e 100644 --- a/src/chronology/domain/Date.test.ts +++ b/src/chronology/domain/Date.test.ts @@ -1,5 +1,5 @@ import { Eponym } from 'chronology/ui/Eponyms' -import { MesopotamianDate, Ur3Calendar } from './Date' // Adjust the import path +import { MesopotamianDate, Ur3Calendar } from './Date' const king = { orderGlobal: 1, @@ -107,7 +107,7 @@ describe('MesopotamianDate', () => { undefined, true ) - expect(date.toString()).toBe('12.V.10 SE (30 August 302 BCE)') + expect(date.toString()).toBe('12.V.10 SE (25 August 301 BCE PGC)') }) it('returns the correct string representation (Seleucid, no day)', () => { @@ -119,7 +119,7 @@ describe('MesopotamianDate', () => { undefined, true ) - expect(date.toString()).toBe('∅.V.10 SE (ca. 19 August 302 BCE)') + expect(date.toString()).toBe('∅.V.10 SE (ca. 14 August 301 BCE PGC)') }) it('returns the correct string representation (Seleucid, no month)', () => { @@ -131,7 +131,7 @@ describe('MesopotamianDate', () => { undefined, true ) - expect(date.toString()).toBe('12.∅.10 SE (ca. 4 May 302 BCE)') + expect(date.toString()).toBe('12.∅.10 SE (ca. 29 April 301 BCE PGC)') }) it('returns the correct string representation (Seleucid, no year)', () => { @@ -156,7 +156,7 @@ describe('MesopotamianDate', () => { undefined, false ) - expect(date.toString()).toBe('12.V.10 Darius I (11 August 512 BCE)') + expect(date.toString()).toBe('12.V.10 Darius I (5 August 511 BCE PGC)') }) it('returns the correct string representation (Nabonassar era, no year)', () => { @@ -169,7 +169,7 @@ describe('MesopotamianDate', () => { undefined, false ) - expect(date.toString()).toBe('∅.V.10 Darius I (ca. 31 July 512 BCE)') + expect(date.toString()).toBe('∅.V.10 Darius I (ca. 25 July 511 BCE PGC)') }) it('returns the correct string representation (Nabonassar era, no month)', () => { @@ -182,7 +182,7 @@ describe('MesopotamianDate', () => { undefined, false ) - expect(date.toString()).toBe('12.∅.10 Darius I (ca. 16 April 512 BCE)') + expect(date.toString()).toBe('12.∅.10 Darius I (ca. 10 April 511 BCE PGC)') }) it('returns the correct string representation (Nabonassar era, no day)', () => { @@ -195,7 +195,7 @@ describe('MesopotamianDate', () => { undefined, false ) - expect(date.toString()).toBe('∅.V.10 Darius I (ca. 31 July 512 BCE)') + expect(date.toString()).toBe('∅.V.10 Darius I (ca. 25 July 511 BCE PGC)') }) it('returns the correct string representation (Ur III)', () => { diff --git a/src/chronology/domain/Date.ts b/src/chronology/domain/Date.ts index 903c2cb50..8f3d84673 100644 --- a/src/chronology/domain/Date.ts +++ b/src/chronology/domain/Date.ts @@ -235,11 +235,8 @@ export class MesopotamianDate { isApproximate: boolean ): string { const converter = new DateConverter() - converter.setSeBabylonianDate(year, month, day) - return this.insertDateApproximation( - converter.toJulianDateString(), - isApproximate - ) + converter.setToSeBabylonianDate(year, month, day) + return this.insertDateApproximation(converter.toDateString(), isApproximate) } private nabonassarEraToJulianDate( @@ -253,9 +250,9 @@ export class MesopotamianDate { ) if (kingName) { const converter = new DateConverter() - converter.setMesopotamianDate(kingName, year, month, day) + converter.setToMesopotamianDate(kingName, year, month, day) return this.insertDateApproximation( - converter.toJulianDateString(), + converter.toDateString(), isApproximate ) } diff --git a/src/chronology/domain/DateConverter.test.ts b/src/chronology/domain/DateConverter.test.ts index 0539cf202..84edf22b0 100644 --- a/src/chronology/domain/DateConverter.test.ts +++ b/src/chronology/domain/DateConverter.test.ts @@ -29,7 +29,10 @@ describe('DateConverter', () => { weekDay: 4, } expect(mesopotamianDate.calendar).toEqual(expected) - expect(mesopotamianDate.toJulianDateString()).toEqual('3 April 311 BCE') + expect(mesopotamianDate.toDateString()).toEqual('29 March 310 BCE PGC') + expect(mesopotamianDate.toDateString('Julian')).toEqual( + '3 April 311 BCE PJC' + ) }) test('Set to Julian date', () => { @@ -54,10 +57,13 @@ describe('DateConverter', () => { } mesopotamianDate.setToJulianDate(-560, 4, 3) expect(mesopotamianDate.calendar).toEqual(expected) - expect(mesopotamianDate.toJulianDateString()).toEqual('3 April 561 BCE') + expect(mesopotamianDate.toDateString()).toEqual('28 March 560 BCE PGC') + expect(mesopotamianDate.toDateString('Julian')).toEqual( + '3 April 561 BCE PJC' + ) }) - test('Set Mesopotamian date', () => { + test('Set to Mesopotamian date', () => { const expected = { gregorianYear: -580, bcGregorianYear: 581, @@ -77,13 +83,16 @@ describe('DateConverter', () => { lunationNabonassar: 2052, seBabylonianYear: -270, } - mesopotamianDate.setMesopotamianDate('Nebuchadnezzar II', 23, 10, 14) + mesopotamianDate.setToMesopotamianDate('Nebuchadnezzar II', 23, 10, 14) expect(mesopotamianDate.calendar).toEqual(expected) - expect(mesopotamianDate.toJulianDateString()).toEqual('3 January 581 BCE') + expect(mesopotamianDate.toDateString()).toEqual('28 December 581 BCE PGC') + expect(mesopotamianDate.toDateString('Julian')).toEqual( + '3 January 581 BCE PJC' + ) }) - test('Set Seleucid date', () => { - mesopotamianDate.setSeBabylonianDate(100, 12, 26) + test('Set to Seleucid date', () => { + mesopotamianDate.setToSeBabylonianDate(100, 12, 26) const expected = { gregorianYear: -209, bcGregorianYear: 210, @@ -106,6 +115,9 @@ describe('DateConverter', () => { mesopotamianDay: 26, } expect(mesopotamianDate.calendar).toEqual(expected) - expect(mesopotamianDate.toJulianDateString()).toEqual('3 April 211 BCE') + expect(mesopotamianDate.toDateString()).toEqual('30 March 210 BCE PGC') + expect(mesopotamianDate.toDateString('Julian')).toEqual( + '3 April 211 BCE PJC' + ) }) }) diff --git a/src/chronology/domain/DateConverter.ts b/src/chronology/domain/DateConverter.ts index f9b08546a..662498b94 100644 --- a/src/chronology/domain/DateConverter.ts +++ b/src/chronology/domain/DateConverter.ts @@ -32,12 +32,23 @@ export default class DateConverter extends DateConverterBase { this.setToJulianDate(-310, 4, 3) } - toJulianDateString(): string { - const { julianDay, julianMonth, julianYear, bcJulianYear } = this.calendar - const suffix = julianYear < 0 ? ' BCE' : ' CE' - return `${julianDay} ${monthNames[julianMonth - 1]} ${ - julianYear < 0 ? bcJulianYear : julianYear - }${suffix}` + toDateString(calendarType: 'Julian' | 'Gregorian' = 'Gregorian'): string { + let { + gregorianDay: day, + gregorianMonth: month, + gregorianYear: year, + bcGregorianYear: bcYear, + } = this.calendar + if (calendarType === 'Julian') { + day = this.calendar.julianDay + month = this.calendar.julianMonth + year = this.calendar.julianYear + bcYear = this.calendar.bcJulianYear + } + const suffix = year < 0 ? ' BCE' : ' CE' + return `${day} ${monthNames[month - 1]} ${ + year < 0 ? bcYear : year + }${suffix}${calendarType === 'Julian' ? ' PJC' : ' PGC'}` } setToGregorianDate( @@ -45,8 +56,12 @@ export default class DateConverter extends DateConverterBase { gregorianMonth: number, gregorianDay: number ): void { - this.applyGregorianDate({ gregorianYear, gregorianMonth, gregorianDay }) - this.updateBabylonianDate() + const cjdn = this.computeCjdnFromGregorianDate( + gregorianYear, + gregorianMonth, + gregorianDay + ) + this.setToCjdn(cjdn) } setToJulianDate( @@ -54,12 +69,15 @@ export default class DateConverter extends DateConverterBase { julianMonth: number, julianDay: number ): void { - this.applyJulianDate({ julianYear, julianMonth, julianDay }) + this.applyDate( + { year: julianYear, month: julianMonth, day: julianDay }, + 'julian' + ) this.applyGregorianDateWhenJulian() this.updateBabylonianDate() } - setSeBabylonianDate( + setToSeBabylonianDate( seBabylonianYear: number, mesopotamianMonth: number, mesopotamianDay: number @@ -69,10 +87,10 @@ export default class DateConverter extends DateConverterBase { mesopotamianMonth, mesopotamianDay ) - this.setFromCjdn(cjdn) + this.setToCjdn(cjdn) } - setMesopotamianDate( + setToMesopotamianDate( ruler: string, regnalYear: number, mesopotamianMonth: number, @@ -87,6 +105,12 @@ export default class DateConverter extends DateConverterBase { mesopotamianMonth, mesopotamianDay ) - this.setFromCjdn(cjdn) + this.setToCjdn(cjdn) + } + + setToCjdn(cjdn: number): void { + this.applyDate(this.computeJulianDateFromCjnd(cjdn), 'julian') + this.applyDate(this.computeGregorianDateFromCjdn(cjdn), 'gregorian') + this.updateBabylonianDate(cjdn) } } diff --git a/src/chronology/domain/DateConverterBase.ts b/src/chronology/domain/DateConverterBase.ts index 52417efaf..541d69d6a 100644 --- a/src/chronology/domain/DateConverterBase.ts +++ b/src/chronology/domain/DateConverterBase.ts @@ -24,9 +24,6 @@ export interface CalendarProps { } interface CalendarUpdateProps { - //gregorianYear: number - //gregorianMonth: number - //gregorianDay: number julianYear: number julianMonth: number julianDay: number @@ -35,9 +32,9 @@ interface CalendarUpdateProps { seBabylonianYear: number lunationNabonassar: number mesopotamianMonth: number - regnalYear: number + ruler?: string + regnalYear?: number i: number - j: number } function divmod( @@ -68,64 +65,26 @@ export default class DateConverterBase { return year < 1 ? 1 - year : undefined } - setFromCjdn(cjdn: number): void { - const [julianYear, julianMonth, julianDay] = this.computeJulianDateFromCjnd( - cjdn - ) - const [ - gregorianYear, - gregorianMonth, - gregorianDay, - ] = this.computeGregorianDateFromCjdn(cjdn) - this.applyJulianDate({ julianYear, julianMonth, julianDay }) - this.applyGregorianDate({ gregorianYear, gregorianMonth, gregorianDay }) - this.updateBabylonianDate(cjdn) - } - - applyGregorianDate({ - gregorianYear, - gregorianMonth, - gregorianDay, - }: Pick< - CalendarProps, - 'gregorianYear' | 'gregorianMonth' | 'gregorianDay' - >): void { - this.calendar = { - ...this.calendar, - gregorianYear, - gregorianMonth, - gregorianDay, - bcGregorianYear: this.getBcYear(gregorianYear), - } - } + applyDate( + { year, month, day }: { year: number; month: number; day: number }, + dateType: 'gregorian' | 'julian' + ): void { + const keyPrefix = dateType === 'gregorian' ? 'gregorian' : 'julian' + const bcYearKey = + dateType === 'gregorian' ? 'bcGregorianYear' : 'bcJulianYear' - applyJulianDate({ - julianYear, - julianMonth, - julianDay, - }: Pick): void { this.calendar = { ...this.calendar, - julianYear, - julianMonth, - julianDay, - bcJulianYear: this.getBcYear(julianYear), + [`${keyPrefix}Year`]: year, + [`${keyPrefix}Month`]: month, + [`${keyPrefix}Day`]: day, + [bcYearKey]: this.getBcYear(year), } } applyGregorianDateWhenJulian(): void { - const { julianYear, julianMonth, julianDay } = this.calendar - const cjdn = this.computeCjdnFromJulianDate( - julianYear, - julianMonth, - julianDay - ) - const [ - gregorianYear, - gregorianMonth, - gregorianDay, - ] = this.computeGregorianDateFromCjdn(cjdn) - this.applyGregorianDate({ gregorianYear, gregorianMonth, gregorianDay }) + const cjdn = this.computeCjdnFromJulianDate({ ...this.calendar }) + this.applyDate(this.computeGregorianDateFromCjdn(cjdn), 'gregorian') } computeCjdnFromSeBabylonian( @@ -140,67 +99,42 @@ export default class DateConverterBase { return data.babylonianCjdnPeriod[i] + mesopotamianDay - 1 } - calculateYearOffset(currentMonth: number, offset: number): number { - return currentMonth + offset > 12 ? 1 : currentMonth + offset < 1 ? -1 : 0 - } - - calculateNewMonth(currentMonth: number, offset: number): number { - return ((currentMonth + offset + 11) % 12) + 1 - } - updateBabylonianDate( - cjdn: number = this.computeCjdnFromJulianDate( - this.calendar.julianYear, - this.calendar.julianMonth, - this.calendar.julianDay - ) + cjdn: number = this.computeCjdnFromJulianDate({ ...this.calendar }) ): void { const weekDay = this.computeWeekDay(cjdn) - const [ - i, - lunationNabonassar, - seBabylonianYear, - mesopotamianMonth, - ] = this.computeBabylonianValues(cjdn) - const [j, regnalYear] = this.computeRegnalValues(seBabylonianYear) + const bablonianValues = this.computeBabylonianValues(cjdn) + const { ruler, regnalYear } = this.computeRegnalValues( + bablonianValues.seBabylonianYear + ) this.updateCalendarProperties({ julianYear: this.calendar.julianYear, julianMonth: this.calendar.julianMonth, julianDay: this.calendar.julianDay, cjdn, weekDay, - lunationNabonassar, - seBabylonianYear, - mesopotamianMonth, + ruler, regnalYear, - i, - j, + ...bablonianValues, }) } - private findIndexInSeBabylonianYearMonthPeriod( - yearMonth: [number, number] - ): number { - const i = data.seBabylonianYearMonthPeriod.findIndex((ym) => - _.isEqual(ym, yearMonth) - ) - if (i === -1) - throw new Error('Could not find matching Babylonian date in data.') - return i - } - - private computeJulianDateFromCjnd(cjdn: number): [number, number, number] { + computeJulianDateFromCjnd( + cjdn: number + ): { year: number; month: number; day: number } { const b = cjdn + 1524 const c = Math.floor((b - 122.1) / 365.25) const d = Math.floor(365.25 * c) const e = Math.floor((b - d) / 30.6001) - const julianDay = b - d - Math.floor(30.6001 * e) - const julianMonth = e < 14 ? e - 1 : e - 13 - const julianYear = julianMonth > 2 ? c - 4716 : c - 4715 - return [julianYear, julianMonth, julianDay] + const day = b - d - Math.floor(30.6001 * e) + const month = e < 14 ? e - 1 : e - 13 + const year = month > 2 ? c - 4716 : c - 4715 + return { year, month, day } } - private computeGregorianDateFromCjdn(cjdn: number): [number, number, number] { + computeGregorianDateFromCjdn( + cjdn: number + ): { year: number; month: number; day: number } { const J0 = 1721120 const s = cjdn - J0 const alpha1 = Math.floor((400 * s + 799) / 146097) @@ -223,17 +157,22 @@ export default class DateConverterBase { 153 ) const { quotient: alpha2b, remainder: m0 } = divmod(m1 + 2, 12) - const year = a1 + alpha2b - const month = m0 + 1 - const day = Math.floor(epsilon1 / 5) + 1 - return [year < 1 ? year + 1 : year, month, day] + return { + year: a1 + alpha2b < 1 ? a1 + alpha2b + 1 : a1 + alpha2b, + month: m0 + 1, + day: Math.floor(epsilon1 / 5) + 1, + } } - private computeCjdnFromJulianDate( - julianYear: number, - julianMonth: number, + private computeCjdnFromJulianDate({ + julianYear, + julianMonth, + julianDay, + }: { + julianYear: number + julianMonth: number julianDay: number - ): number { + }): number { if (julianMonth < 3) { julianYear -= 1 julianMonth += 12 @@ -248,7 +187,7 @@ export default class DateConverterBase { } //ToDo: Check, (update), use! - private computeCjdnFromGregorianDate( + computeCjdnFromGregorianDate( gregorianYear: number, gregorianMonth: number, gregorianDay: number @@ -270,36 +209,51 @@ export default class DateConverterBase { private computeBabylonianValues( cjdn: number - ): [number, number, number, number] { + ): { + i: number + lunationNabonassar: number + seBabylonianYear: number + mesopotamianMonth: number + } { const i = data.babylonianCjdnPeriod.findIndex((cjdnPd) => cjdnPd > cjdn) const [ seBabylonianYear, mesopotamianMonth, ] = data.seBabylonianYearMonthPeriod[i - 1] - return [i, 1498 + i, seBabylonianYear, mesopotamianMonth] + return { + i, + lunationNabonassar: 1498 + i, + seBabylonianYear, + mesopotamianMonth, + } } - private computeRegnalValues(seBabylonianYear: number): [number, number] { + private computeRegnalValues( + seBabylonianYear: number + ): { ruler?: string; regnalYear: number } { const j = data.rulerSeYears.findIndex((year) => year > seBabylonianYear) - return [j, seBabylonianYear - data.rulerSeYears[j - 1] + 1] + const ruler = seBabylonianYear < 161 ? data.rulerName[j - 1] : undefined + const regnalYear = seBabylonianYear - data.rulerSeYears[j - 1] + 1 + return { ruler, regnalYear } } private updateCalendarProperties(props: CalendarUpdateProps): void { const { cjdn, weekDay, julianYear, julianMonth, julianDay } = props this.calendar.cjdn = cjdn this.calendar.weekDay = weekDay - this.applyJulianDate({ julianYear, julianMonth, julianDay }) + this.applyDate( + { year: julianYear, month: julianMonth, day: julianDay }, + 'julian' + ) this.applyBabylonianDate(props) this.applySeleucidDate(props) } private applyBabylonianDate(props: CalendarUpdateProps): void { - const { cjdn, seBabylonianYear, mesopotamianMonth, i, j } = props + const { cjdn, mesopotamianMonth, i, ruler, regnalYear } = props const mesopotamianDay = cjdn - data.babylonianCjdnPeriod[i - 1] + 1 const mesopotamianMonthLength = data.babylonianCjdnPeriod[i] - data.babylonianCjdnPeriod[i - 1] - const ruler = seBabylonianYear < 161 ? data.rulerName[j - 1] : undefined - const regnalYear = seBabylonianYear - data.rulerSeYears[j - 1] + 1 const lunationNabonassar = 1498 + i this.calendar = { ...this.calendar, @@ -343,4 +297,15 @@ export default class DateConverterBase { private calculateSeArsacidYear(seBabylonianYear: number): number | undefined { return seBabylonianYear >= 65 ? seBabylonianYear - 64 : undefined } + + private findIndexInSeBabylonianYearMonthPeriod( + yearMonth: [number, number] + ): number { + const i = data.seBabylonianYearMonthPeriod.findIndex((ym) => + _.isEqual(ym, yearMonth) + ) + if (i === -1) + throw new Error('Could not find matching Babylonian date in data.') + return i + } } diff --git a/src/chronology/domain/dateConverterData.json b/src/chronology/domain/dateConverterData.json index 1b02e4dee..fa09d26f0 100644 --- a/src/chronology/domain/dateConverterData.json +++ b/src/chronology/domain/dateConverterData.json @@ -62,25 +62,7 @@ "Demetrius I Soter": 195, "Alexander Balas": 196 }, - "rulerSeYears": [ - -436, - -422, - -420, - -417, - -415, - -410, - -398, - -393, - -391, - -388, - -382, - -381, - -377, - -369, - -356, - -336, - -314, -313, -292, -249, diff --git a/src/chronology/ui/DateConverterForm.tsx b/src/chronology/ui/DateConverterForm.tsx index 483d2e2ad..36d3164a1 100644 --- a/src/chronology/ui/DateConverterForm.tsx +++ b/src/chronology/ui/DateConverterForm.tsx @@ -82,12 +82,12 @@ function DateConverterForm(): JSX.Element { mesopotamianMonth, mesopotamianDay, } = _formData - const setSeBabylonianDateArgs = [ + const setToSeBabylonianDateArgs = [ seBabylonianYear, mesopotamianMonth, mesopotamianDay, ] - const setMesopotamianDateArgs = [ + const setToMesopotamianDateArgs = [ ruler, regnalYear, mesopotamianMonth, @@ -106,19 +106,19 @@ function DateConverterForm(): JSX.Element { julianDay as number ) } else if ( - scenario === 'setSeBabylonianDate' && - !setSeBabylonianDateArgs.includes(undefined) + scenario === 'setToSeBabylonianDate' && + !setToSeBabylonianDateArgs.includes(undefined) ) { - dateConverter.setSeBabylonianDate( + dateConverter.setToSeBabylonianDate( seBabylonianYear as number, mesopotamianMonth as number, mesopotamianDay as number ) } else if ( - scenario === 'setMesopotamianDate' && - !setMesopotamianDateArgs.includes(undefined) + scenario === 'setToMesopotamianDate' && + !setToMesopotamianDateArgs.includes(undefined) ) { - dateConverter.setMesopotamianDate( + dateConverter.setToMesopotamianDate( ruler as string, regnalYear as number, mesopotamianMonth as number, @@ -140,13 +140,13 @@ function DateConverterForm(): JSX.Element { ) case 'setToJulianDate': return ['julianYear', 'julianMonth', 'julianDay'].includes(fieldName) - case 'setSeBabylonianDate': + case 'setToSeBabylonianDate': return [ 'seBabylonianYear', 'mesopotamianMonth', 'mesopotamianDay', ].includes(fieldName) - case 'setMesopotamianDate': + case 'setToMesopotamianDate': return [ 'ruler', 'regnalYear', @@ -261,8 +261,8 @@ function DateConverterForm(): JSX.Element { const scenarioLabels = { setToGregorianDate: 'Modern date', setToJulianDate: 'Julian date', - setSeBabylonianDate: 'Seleucid (Babylonian) date', - setMesopotamianDate: 'Nabonassar date', + setToSeBabylonianDate: 'Seleucid (Babylonian) date', + setToMesopotamianDate: 'Nabonassar date', } function getControls(): JSX.Element { diff --git a/src/chronology/ui/DatesInTextSelection.test.tsx b/src/chronology/ui/DatesInTextSelection.test.tsx index e2e9fcd35..01be7941a 100644 --- a/src/chronology/ui/DatesInTextSelection.test.tsx +++ b/src/chronology/ui/DatesInTextSelection.test.tsx @@ -49,7 +49,7 @@ describe('DatesInTextSelection', () => { fireEvent.click(saveButton) }) await waitFor(() => expect(mockUpdateDatesInText).toHaveBeenCalledTimes(1)) - expect(screen.getByText('1.I.1 SE (3 April 311 BCE)')).toBeVisible() + expect(screen.getByText('1.I.1 SE (29 March 310 BCE PGC)')).toBeVisible() }) it('updates a date in the list', async () => { @@ -67,7 +67,7 @@ describe('DatesInTextSelection', () => { fireEvent.click(saveButton) }) await waitFor(() => expect(mockUpdateDatesInText).toHaveBeenCalledTimes(1)) - expect(screen.getByText('1.I.1 SE (3 April 311 BCE)')).toBeVisible() + expect(screen.getByText('1.I.1 SE (29 March 310 BCE PGC)')).toBeVisible() }) it('deletes a date from the list', async () => { diff --git a/src/fragmentarium/ui/search/__snapshots__/FragmentariumSearch.test.tsx.snap b/src/fragmentarium/ui/search/__snapshots__/FragmentariumSearch.test.tsx.snap index d55f376f9..8d0ca9993 100644 --- a/src/fragmentarium/ui/search/__snapshots__/FragmentariumSearch.test.tsx.snap +++ b/src/fragmentarium/ui/search/__snapshots__/FragmentariumSearch.test.tsx.snap @@ -728,7 +728,7 @@ exports[`Searching fragments by transliteration Displays corpus results when cli class="mesopotamian-date-display" role="time" > - 1.I.1 SE (3 April 311 BCE) + 1.I.1 SE (29 March 310 BCE PGC) @@ -6492,7 +6492,7 @@ exports[`Searching fragments by transliteration Displays corpus results when cli class="mesopotamian-date-display" role="time" > - 1.I.1 SE (3 April 311 BCE) + 1.I.1 SE (29 March 310 BCE PGC)