Skip to content

Commit 0cc8ce6

Browse files
committed
test: fix playwright tests
1 parent 17dc2bd commit 0cc8ce6

11 files changed

Lines changed: 24 additions & 33 deletions

File tree

e2e/helpers/getters/lineage-view/history/get-snapshots-button.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import invariant from 'tiny-invariant';
22
import { getActiveView } from '../card/get-active-view';
33

4-
export const SEL_CONTROLS_GROUP = '.lineage-view-control-group';
4+
export const SEL_CONTROLS_GROUP = '.controls-container';
55
export const getSnapshotsButton = async () => {
66
const view = await getActiveView();
77
const button = await view.$(

e2e/tests/card-buttons.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ test.describe('card buttons', () => {
102102

103103
await toggleCardEditUsingButton();
104104

105-
const n1_text2 = text();
105+
const n1_text2 = text(1);
106106
await typeText(n1_text2);
107107
await saveCardUsingButton();
108108
const cs = await getTextsOfColumns();

e2e/tests/card-hotkeys.spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,17 @@ test.describe('card hotkeys', () => {
155155
expect(await getTextsOfColumns()).toEqual([[n4, n3, n2, n1]]);
156156

157157
await mergeCardUsingHotkey('down');
158-
const n4_n3 = `${n4}\n${n3}`;
158+
// eslint-disable-next-line no-irregular-whitespace
159+
const n4_n3 = `${n4} \n${n3}`;
159160
expect(await getTextsOfColumns()).toEqual([[n4_n3, n2, n1]]);
160161

161162
await selectCard(0, 2);
162163
await mergeCardUsingHotkey('down');
163164
expect(await getTextsOfColumns()).toEqual([[n4_n3, n2, n1]]);
164165

165166
await mergeCardUsingHotkey('up');
166-
const n2_n1 = `${n2}\n${n1}`;
167+
// eslint-disable-next-line no-irregular-whitespace
168+
const n2_n1 = `${n2} \n${n1}`;
167169
expect(await getTextsOfColumns()).toEqual([[n4_n3, n2_n1]]);
168170
});
169171

e2e/tests/text-area.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,9 @@ test('should handle multiple text areas in parallel', async () => {
219219

220220
// go to f1
221221
await goToTab(1);
222-
await saveCardUsingHotkey();
223222
expect(await getTextsOfColumns()).toEqual([[n1]]);
224223

225224
// go to f2
226225
await goToTab(2);
227-
await saveCardUsingHotkey();
228226
expect(await getTextsOfColumns()).toEqual([[n2]]);
229227
});

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "lineage",
33
"name": "Lineage",
4-
"version": "0.4.0-dev",
4+
"version": "0.5.0-dev",
55
"minAppVersion": "0.15.0",
66
"description": "Gingko writing experience.",
77
"author": "ycnmhd",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lineage",
3-
"version": "0.4.0-dev",
3+
"version": "0.5.0-dev",
44
"description": "",
55
"scripts": {
66
"dev": "node esbuild.config.mjs",

src/stores/settings/settings-reducer.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -123,21 +123,13 @@ const updateState = (store: Settings, action: SettingsActions) => {
123123
} else if (action.type === 'SET_LIMIT_PREVIEW_HEIGHT') {
124124
store.view.limitPreviewHeight = action.payload.limit;
125125
} else if (action.type === 'BACKUP/ADD_FILE') {
126-
const overridingExistingBackup =
127-
store.backup[action.payload.path] &&
128-
store.backup[action.payload.path].content !==
129-
action.payload.content;
130-
if (overridingExistingBackup) {
131-
throw new Error(
132-
`a different backup of '${action.payload.path}' exists`,
133-
);
134-
}
135126
store.backup[action.payload.path] = {
136127
content: action.payload.content,
137128
created: Date.now(),
138129
};
139130
} else if (action.type === 'BACKUP/DELETE_FILE') {
140-
delete store.backup[action.payload.path];
131+
if (store.backup[action.payload.path])
132+
delete store.backup[action.payload.path];
141133
} else if (action.type === 'UPDATE_DOCUMENTS_DICTIONARY') {
142134
store.documents = action.payload.documents;
143135
}

src/view/actions/keyboard-shortcuts/helpers/commands/commands/helpers/add-node-and-split-at-cursor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ export const addNodeAndSplitAtCursor = (
3333
secondHalf = value.substring(cursor);
3434
if (direction === 'up') {
3535
view.inlineEditor.setContent(secondHalf);
36-
text = firstHalf;
36+
text = firstHalf.trimEnd();
3737
} else {
3838
view.inlineEditor.setContent(firstHalf);
39-
text = secondHalf;
39+
text = secondHalf.trimStart();
4040
}
4141
}
4242

src/view/components/container/breadcrumbs/breadcrumbs-item.svelte

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,22 @@
3232
.separator {
3333
padding: 2px 1px;
3434
color: var(--text-faint);
35+
min-width: 8px;
3536
}
3637
.breadcrumbs-item {
37-
box-shadow: none;
3838
height: 30px;
39-
display: flex;
40-
line-height: 1;
41-
font-size: inherit;
42-
align-items: center;
43-
justify-content: center;
4439
border-bottom: 1px solid var(--background-modifier-border);
4540
color: var(--text-muted);
4641
background-color: var(--interactive-normal);
47-
--icon-size: var(--icon-s);
48-
--icon-stroke: var(--icon-s-stroke-width);
4942
cursor: pointer;
5043
padding: 2px 4px;
5144
border-radius: var(--radius-s);
52-
max-width: 300px;
45+
max-width: 350px;
5346
white-space: nowrap;
5447
overflow: hidden;
5548
text-overflow: ellipsis;
49+
font-size: 14px;
50+
line-height: 25px;
5651
}
5752
5853
.breadcrumbs-item:hover {

src/view/components/container/controls-bar/modals/snapshots-list/components/snapshot-button.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,6 @@
143143
}
144144
.snapshot-time {
145145
font-size: 11px;
146-
color: var(--color-base-40);
146+
color: var(--color-base-60);
147147
}
148148
</style>

0 commit comments

Comments
 (0)