Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(test): Chromaticが落ちているのを一部修正? #13435

Merged
merged 3 commits into from
Feb 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import MkTime from './MkTime.vue';
import { i18n } from '@/i18n.js';
import { dateTimeFormat } from '@/scripts/intl-const.js';
const now = new Date('2023-04-01T00:00:00.000Z');
const future = new Date(8640000000000000);
const future = new Date('3000-04-01T00:00:00.000Z');
const oneHourAgo = new Date(now.getTime() - 3600000);
const oneDayAgo = new Date(now.getTime() - 86400000);
const oneWeekAgo = new Date(now.getTime() - 604800000);
Expand Down Expand Up @@ -49,11 +49,12 @@ export const Empty = {
export const RelativeFuture = {
...Empty,
async play({ canvasElement }) {
await expect(canvasElement).toHaveTextContent(i18n.ts._ago.future);
await expect(canvasElement).toHaveTextContent(i18n.tsx._timeIn.years({ n: 977 }));
Copy link
Contributor

@tai-cha tai-cha Feb 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

決めうちの方がパフォーマンスいいからみたいなのなければこっちの方が事故らなそう

Suggested change
await expect(canvasElement).toHaveTextContent(i18n.tsx._timeIn.years({ n: 977 }));
await expect(canvasElement).toHaveTextContent(i18n.tsx._timeIn.years({ n: future.getFullYear() - now.getFullYear() }));

Copy link
Contributor Author

@kakkokari-gtyih kakkokari-gtyih Feb 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

この下のやつが決め打ちになってたのでそうしたんだけどいいのかしら

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

うーん、まあ決め打ちでもいいのかもしれない(けどこれ何の数字?にはなるので決め打ちならコメント欲しいかも)

},
args: {
...Empty.args,
time: future,
origin: now,
},
} satisfies StoryObj<typeof MkTime>;
export const AbsoluteFuture = {
Expand Down
Loading