box-ui-elements 20.0.0-beta.4 → 20.0.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/i18n/bn-IN.properties
CHANGED
|
@@ -1307,7 +1307,7 @@ boxui.quickSearch.parentFolder = অভিভাবকের ফোল্ডা
|
|
|
1307
1307
|
# Icon title for a Box item of type folder that is private and has no collaborators
|
|
1308
1308
|
boxui.quickSearch.personalFolder = ব্যক্তিগত ফোল্ডার
|
|
1309
1309
|
# Text for a quick search result describing the date when the user last updated the item
|
|
1310
|
-
boxui.quickSearch.updatedText =
|
|
1310
|
+
boxui.quickSearch.updatedText = {user}{date, date, medium} দ্বারা
|
|
1311
1311
|
# Statement describing when and who last updated a quick search result item, capitalize if appropriate
|
|
1312
1312
|
boxui.quickSearch.updatedTextToday = আজ {user}-এর মধ্যে
|
|
1313
1313
|
# Statement describing when and who last updated a quick search result item, capitalize if appropriate
|
package/package.json
CHANGED
|
@@ -8,38 +8,48 @@ const SEC_IN_MS = 1e3;
|
|
|
8
8
|
const YEAR_IN_MS = 3.154e10;
|
|
9
9
|
|
|
10
10
|
describe('timeFromNow function', () => {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
const originalDateNow = Date.now;
|
|
12
|
+
const fixedDate = 1629133900000; // Fixed timestamp for testing.
|
|
13
|
+
beforeAll(() => {
|
|
14
|
+
Date.now = jest.fn(() => fixedDate);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
afterAll(() => {
|
|
18
|
+
Date.now = originalDateNow;
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('should return correct value and unit for time difference greater than a year', () => {
|
|
22
|
+
const ms = fixedDate + YEAR_IN_MS * 4;
|
|
13
23
|
expect(timeFromNow(ms)).toEqual({ value: 4, unit: 'year' });
|
|
14
24
|
});
|
|
15
25
|
|
|
16
|
-
it('should return correct
|
|
17
|
-
const ms =
|
|
26
|
+
it('should return correct value and unit for time difference greater than a week', () => {
|
|
27
|
+
const ms = fixedDate + WEEK_IN_MS * 2;
|
|
18
28
|
expect(timeFromNow(ms)).toEqual({ value: 2, unit: 'week' });
|
|
19
29
|
});
|
|
20
30
|
|
|
21
|
-
it('should return correct
|
|
22
|
-
const ms =
|
|
31
|
+
it('should return correct value and unit for time difference greater than a day', () => {
|
|
32
|
+
const ms = fixedDate + DAY_IN_MS * 2;
|
|
23
33
|
expect(timeFromNow(ms)).toEqual({ value: 2, unit: 'day' });
|
|
24
34
|
});
|
|
25
35
|
|
|
26
|
-
it('should return correct
|
|
27
|
-
const ms =
|
|
36
|
+
it('should return correct value and unit for time difference greater than an hour', () => {
|
|
37
|
+
const ms = fixedDate + HOUR_IN_MS * 2;
|
|
28
38
|
expect(timeFromNow(ms)).toEqual({ value: 2, unit: 'hour' });
|
|
29
39
|
});
|
|
30
40
|
|
|
31
|
-
it('should return correct
|
|
32
|
-
const ms =
|
|
41
|
+
it('should return correct value and unit for time difference greater than a minute', () => {
|
|
42
|
+
const ms = fixedDate + MIN_IN_MS * 2;
|
|
33
43
|
expect(timeFromNow(ms)).toEqual({ value: 2, unit: 'minute' });
|
|
34
44
|
});
|
|
35
45
|
|
|
36
|
-
it('should return correct
|
|
37
|
-
const ms =
|
|
46
|
+
it('should return correct value and unit for time difference greater than a second', () => {
|
|
47
|
+
const ms = fixedDate + SEC_IN_MS * 2;
|
|
38
48
|
expect(timeFromNow(ms)).toEqual({ value: 2, unit: 'second' });
|
|
39
49
|
});
|
|
40
50
|
|
|
41
51
|
it('should return correct negative difference', () => {
|
|
42
|
-
const ms =
|
|
52
|
+
const ms = fixedDate - DAY_IN_MS * 2;
|
|
43
53
|
expect(timeFromNow(ms)).toEqual({ value: -2, unit: 'day' });
|
|
44
54
|
});
|
|
45
55
|
});
|