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

[FW] Bump owl version #2261

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
11 changes: 7 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"xmlSelfClosingSpace": false
},
"dependencies": {
"@odoo/owl": "2.0.3",
"@odoo/owl": "2.0.9",
"bootstrap": "^5.1.3"
},
"jest": {
Expand Down
3 changes: 3 additions & 0 deletions src/components/grid_overlay/grid_overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ export class GridOverlay extends Component<Props, SpreadsheetChildEnv> {
onMounted(() => {
resizeObserver.observe(this.gridOverlayEl);
});
onWillUnmount(() => {
resizeObserver.disconnect();
});
useTouchMove(this.gridOverlay, this.props.onGridMoved, () => {
const { scrollY } = this.env.model.getters.getActiveSheetDOMScrollInfo();
return scrollY > 0;
Expand Down
2 changes: 1 addition & 1 deletion src/components/selection_input/selection_input.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
'o-invalid': isInvalid || !range.isValidRange,
'text-decoration-underline': range.isFocused and state.mode === 'select-range'
}"
t-ref="{{range.isFocused ? 'focused' : 'unfocused'}}Input"
t-ref="{{range.isFocused ? 'focusedInput' : 'unfocusedInput' + range_index}}"
/>
<button
class="o-btn o-remove-selection"
Expand Down
2 changes: 1 addition & 1 deletion tests/components/__snapshots__/context_menu.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Standalone context menu tests Context Menu context menu simple rendering 1`] = `
exports[`Context Menu integration tests context menu simple rendering 1`] = `
<div
class="o-menu"
>
Expand Down
35 changes: 17 additions & 18 deletions tests/components/bottom_bar.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,17 @@ async function mountBottomBar(
): Promise<{ parent: Parent; model: Model }> {
let parent: Component;
({ fixture, parent } = await mountComponent(Parent, { model, env, props: { model } }));
return { parent: parent as Parent, model: parent.props.model };
return { parent: parent as Parent, model };
}

describe("BottomBar component", () => {
test("simple rendering", async () => {
await mountBottomBar();

expect(fixture.querySelector(".o-spreadsheet-bottom-bar")).toMatchSnapshot();
});

test("Can create a new sheet", async () => {
const { model } = await mountBottomBar();

const dispatch = jest.spyOn(model, "dispatch");
mockUuidV4To(model, 42);
const activeSheetId = model.getters.getActiveSheetId();
Expand Down Expand Up @@ -112,7 +110,6 @@ describe("BottomBar component", () => {

test("Can open context menu of a sheet", async () => {
await mountBottomBar();

expect(fixture.querySelectorAll(".o-menu")).toHaveLength(0);
triggerMouseEvent(".o-sheet", "contextmenu");
await nextTick();
Expand All @@ -121,15 +118,13 @@ describe("BottomBar component", () => {

test("Can open context menu of a sheet with the arrow", async () => {
await mountBottomBar();

expect(fixture.querySelectorAll(".o-menu")).toHaveLength(0);
await click(fixture, ".o-sheet-icon");
expect(fixture.querySelectorAll(".o-menu")).toHaveLength(1);
});

test("Click on the arrow when the context menu is open should close it", async () => {
await mountBottomBar();

expect(fixture.querySelectorAll(".o-menu")).toHaveLength(0);
await click(fixture, ".o-sheet-icon");
expect(fixture.querySelectorAll(".o-menu")).toHaveLength(1);
Expand Down Expand Up @@ -165,10 +160,11 @@ describe("BottomBar component", () => {
});

test("Can move right a sheet", async () => {
const { model } = await mountBottomBar();
const dispatch = jest.spyOn(model, "dispatch");
const model = new Model();
createSheet(model, { sheetId: "42" });
await nextTick();
await mountBottomBar(model);
const dispatch = jest.spyOn(model, "dispatch");

triggerMouseEvent(".o-sheet", "contextmenu");
await nextTick();
const sheetId = model.getters.getActiveSheetId();
Expand All @@ -180,12 +176,13 @@ describe("BottomBar component", () => {
});

test("Can move left a sheet", async () => {
const { model } = await mountBottomBar();
const model = new Model();
createSheet(model, { sheetId: "42", activate: true });
await mountBottomBar(model);
const dispatch = jest.spyOn(model, "dispatch");
createSheet(model, { sheetId: "42" });
activateSheet(model, "42");
await nextTick();
triggerMouseEvent(".o-sheet[data-id='42']", "contextmenu");

const target = fixture.querySelectorAll(".o-sheet")[1]!;
triggerMouseEvent(target, "contextmenu");
await nextTick();
const sheetId = model.getters.getActiveSheetId();
await click(fixture, ".o-menu-item[data-name='move_left'");
Expand All @@ -196,10 +193,10 @@ describe("BottomBar component", () => {
});

test("Can hide a sheet", async () => {
const { model } = await mountBottomBar();
const dispatch = jest.spyOn(model, "dispatch");
const model = new Model();
createSheet(model, { sheetId: "42" });
activateSheet(model, "42");
await mountBottomBar(model);
const dispatch = jest.spyOn(model, "dispatch");

triggerMouseEvent(".o-sheet", "contextmenu");
await nextTick();
Expand All @@ -211,9 +208,10 @@ describe("BottomBar component", () => {
});

test("Hide sheet menu is not visible if there's only one visible sheet", async () => {
const { model } = await mountBottomBar();
const model = new Model();
createSheet(model, { sheetId: "42" });
hideSheet(model, "42");
await mountBottomBar(model);

triggerMouseEvent(".o-sheet", "contextmenu");
await nextTick();
Expand Down Expand Up @@ -366,6 +364,7 @@ describe("BottomBar component", () => {
const { model } = await mountBottomBar();
const sheet = model.getters.getActiveSheetId();
createSheet(model, { sheetId: "42" });

expect(fixture.querySelectorAll(".o-menu")).toHaveLength(0);
await click(fixture, ".o-list-sheets");
expect(fixture.querySelectorAll(".o-menu")).toHaveLength(1);
Expand Down
2 changes: 1 addition & 1 deletion tests/components/charts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ let sheetId: string;

let parent: Spreadsheet;

describe("figures", () => {
describe("charts", () => {
beforeEach(async () => {
mockChartData = mockChart();
chartId = "someuuid";
Expand Down
Loading