Merge gmpl main2 (#37)

* addPage for gmpl

* implement gmpl full_functional

* final

* del unused variable

* change type of variable

* change test

* code fix

* code fix

* fixing var error (var -> let)

---------

Co-authored-by: SinusFox <61253950+SinusFox@users.noreply.github.com>
This commit is contained in:
moebiusl
2024-10-11 23:25:56 +02:00
committed by GitHub
parent 3f0f1b8a12
commit 218d15ff51
8 changed files with 620 additions and 11 deletions
+8 -2
View File
@@ -20,6 +20,13 @@ jest.mock('../src/solver/glpk.min.js', () => ({
// Mocking console.log
const consoleLogMock = jest.spyOn(console, 'log').mockImplementation(() => {});
// Mock useRouter to avoid invariant error
jest.mock('next/navigation', () => ({
useRouter: jest.fn(() => ({
push: jest.fn(), // Mock the 'push' function
})),
}));
beforeEach(() => {
document.body.innerHTML = `
<div>
@@ -90,7 +97,7 @@ test('calculate_click should display "Calculating" in the output box', () => {
document.getElementById('bounds').value = 'x <= 5';
document.getElementById('vars').value = 'x\ny';
// Simuliere den Button-Klick, der die Berechnung startet
// Simulate the button click to trigger calculation
fireEvent.click(screen.getByText('Calculate'));
// Check the contents of out box
@@ -101,4 +108,3 @@ test('calculate_click should display "Calculating" in the output box', () => {
mockClear.mockRestore();
mockLog.mockRestore();
});