Skip to content

Commit 83daa9f

Browse files
committed
Added data to test the fix
1 parent 05ea379 commit 83daa9f

5 files changed

+136
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"data": {
3+
"type": "card",
4+
"attributes": {
5+
"pgn": "1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Nb8 10. d4 Nbd7 11. c4 c6 12. Nc3 Bb7 13. Bg5 h6 14. Bh4 Re8 15. cxb5 axb5 16. a3 Bf8 17. Rc1 Qb6 18. Bg3 Rad8 19. d5 c5 20. Nd2 g6 21. Bc2 Bg7 22. Bd3 c4 23. Bc2 Nc5 24. b4 cxb3 25. Nxb3 Nxb3 26. Bxb3 Rc8 27. Qd3 Ba6 28. Na2 Nd7 29. Nb4 Nc5 30. Qb1 Bb7 31. Kh1 Re7 32. f3 Rec7 33. Bf2 Bf8 34. Rc3 Qa7 35. Rec1 Qa8 36. Qa2 Be7 37. Be3 Bf8 38. Kh2 Be7 39. R1c2 Qa7 40. Qb1 Bg5 41. Bxg5 hxg5 42. Nd3 Kg7 43. Ba2 f5 44. Qc1 fxe4 45. Qxg5 Ba6 46. Nb4 Bb7 47. fxe4 Qa8 48. Rg3 Kh7 49. Qxg6+ Kh8 50. Qh6+ Rh7 51. Qf6+ Rg7 52. Rg4 Ba6 53. Nc6 Re8 54. Bb3 Bc8 55. Rg5 Rf8 56. Qxd6 Nxe4 57. Qxe5 Nxg5 58. Qxg5 Rxg5 59. d6 Bd7 60. Ne5 Be8 61. d7 Bxd7 62. Nxd7 Rff2 63. Rc8+ Kh7 64. Nf6+ Kg6 65. Bd5 Rxf6 66. Be4+ Kh5 67. Rc3 Rf2 68. Re3 Ra2 69. Bf3+ Kg6 70. Bg4 Qxg2#",
6+
"dateOfGame": "2022-12-12",
7+
"whitePlayer": "Magnus Carlsen",
8+
"blackPlayer": "Ian Nepomniachtchi",
9+
"title": "Magnus Carlsen vs Ian Nepomniachtchi - 2022 World Championship",
10+
"description": "A thrilling game in the 2022 World Championship where Magnus Carlsen faced Ian Nepomniachtchi. An intense battle showcasing advanced strategies.",
11+
"thumbnailURL": "https://www.chessdom.com/wp-content/uploads/2022/09/nepo-magnus-end-nr.jpeg"
12+
},
13+
"meta": {
14+
"adoptsFrom": {
15+
"module": "../chess-gallery",
16+
"name": "ChessGallery"
17+
}
18+
}
19+
}
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"data": {
3+
"type": "card",
4+
"attributes": {
5+
"pgn": "1. e4 c5 2. Nf3 Nc6 3. Bb5 g6 4. O-O Bg7 5. Re1 e5 6. c3 Nge7 7. d4 cxd4 8. cxd4 exd4 9. e5 a6 10. Bf1 O-O 11. Na3 d6 12. exd6 Qxd6 13. Nc4 Qc7 14. g3 Nd5 15. Bg2 Rd8 16. Bg5 f6 17. Bd2 b5 18. Na3 Kh8 19. Rc1 Qb6 20. Qb3 Bf8 21. Nh4 Nde7 22. Qf7 Bg7 23. Rxc6 Qxc6 24. Rxe7 Qxg2+ 25. Kxg2 Rg8 26. Bh6 Bh3+ 27. Kxh3 Ra7 28. Bxg7+ Rxg7 29. Re8+ Rg8 30. Rxg8#",
6+
"dateOfGame": "2022-08-06",
7+
"whitePlayer": "Gukesh D",
8+
"blackPlayer": "Alexei Shirov",
9+
"title": "Gukesh D vs Alexei Shirov - 2022 Chess Olympiad",
10+
"description": "A remarkable victory by Gukesh over Alexei Shirov at the 2022 Chess Olympiad, showcasing his extraordinary talent and strategic prowess.",
11+
"thumbnailURL": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRqPDi__ejymzQm5Ho7m6zWAOExXkYS-DcAmw&s"
12+
},
13+
"meta": {
14+
"adoptsFrom": {
15+
"module": "../chess-gallery",
16+
"name": "ChessGallery"
17+
}
18+
}
19+
}
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{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"Kasparov's Immortal Game - 1999",
10+
"description": "Garry Kasparov's stunning victory against Veselin Topalov at the 1999 Wijk aan Zee tournament, often referred to as Kasparov's Immortal.",
11+
"thumbnailURL": "https://i.ytimg.com/vi/9PwSa7hkiKc/maxresdefault.jpg"
12+
},
13+
"meta": {
14+
"adoptsFrom": {
15+
"module": "../chess-gallery",
16+
"name": "ChessGallery"
17+
}
18+
}
19+
}
20+
}

Diff for: packages/realm-server/tests/cards/chess-gallery.gts

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import DateField from 'https://cardstack.com/base/date';
2+
import {
3+
FieldDef,
4+
field,
5+
contains,
6+
StringField,
7+
} from 'https://cardstack.com/base/card-api';
8+
import { Component } from 'https://cardstack.com/base/card-api';
9+
10+
// This is intentionally using a FieldDef so it can replicate the error in
11+
// https://linear.app/cardstack/issue/CS-7797/indexer-hangs-when-encountering-instance-json-that-refers-to-a-field
12+
export class ChessGallery extends FieldDef {
13+
@field pgn = contains(StringField);
14+
@field dateOfGame = contains(DateField);
15+
@field whitePlayer = contains(StringField);
16+
@field blackPlayer = contains(StringField);
17+
static displayName = 'Chess Gallery';
18+
19+
static edit = class Edit extends Component<typeof this> {
20+
<template>
21+
<div class='chess-gallery-edit'>
22+
<@fields.whitePlayer />
23+
<@fields.blackPlayer />
24+
<@fields.dateOfGame />
25+
<@fields.pgn />
26+
</div>
27+
<style scoped>
28+
.chess-gallery-edit {
29+
display: grid;
30+
gap: var(--boxel-sp);
31+
}
32+
</style>
33+
</template>
34+
};
35+
36+
static embedded = class Embedded extends Component<typeof this> {
37+
<template>
38+
<div class='chess-gallery-view'>
39+
<div class='players'>
40+
<span class='white'>{{@model.whitePlayer}}</span>
41+
vs
42+
<span class='black'>{{@model.blackPlayer}}</span>
43+
</div>
44+
</div>
45+
<style scoped>
46+
.chess-gallery-view {
47+
padding: var(--boxel-sp);
48+
}
49+
.players {
50+
font-weight: 600;
51+
margin-bottom: var(--boxel-sp-xxs);
52+
}
53+
.white,
54+
.black {
55+
color: var(--boxel-purple-600);
56+
}
57+
</style>
58+
</template>
59+
};
60+
}

Diff for: packages/realm-server/tests/realm-server-test.ts

+16
Original file line numberDiff line numberDiff line change
@@ -4849,6 +4849,22 @@ module(basename(__filename), function () {
48494849
kind: 'file',
48504850
},
48514851
},
4852+
'chess-gallery.gts': {
4853+
links: {
4854+
related: `${testRealmHref}chess-gallery.gts`,
4855+
},
4856+
meta: {
4857+
kind: 'file',
4858+
},
4859+
},
4860+
'ChessGallery/': {
4861+
links: {
4862+
related: `${testRealmHref}ChessGallery/`,
4863+
},
4864+
meta: {
4865+
kind: 'directory',
4866+
},
4867+
},
48524868
'code-ref-test.gts': {
48534869
links: {
48544870
related: `${testRealmHref}code-ref-test.gts`,

0 commit comments

Comments
 (0)