Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6320c00f authored by Paula's avatar Paula
Browse files

Merge branch 'integration-remote-2-2-images' into feature/#2667

# Conflicts:
#	app/src/static/index.html
parents 85b4fac5 d8c7071b
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -19,7 +19,7 @@ Go to the `app` folder.
`docker run -v "%cd%"\src:/app/src -p 127.0.0.1:3000:3000 eos-web-installer`
`docker run -v "%cd%"\src:/app/src -p 127.0.0.1:3000:3000 eos-web-installer`


## Linux
## Linux
`docker run -v "${pwd}"\src:/app/src -p 127.0.0.1:3000:3000 eos-web-installer`
`docker run -v "$(pwd)/src:/app/src" -p 127.0.0.1:3000:3000 eos-web-installer`


The project is available at `http://localhost:3000/`
The project is available at `http://localhost:3000/`


+2 −2
Original line number Original line Diff line number Diff line
# syntax=docker/dockerfile:1
# syntax=docker/dockerfile:1
   
   
FROM node:18-alpine
FROM node:22-alpine
WORKDIR /app
WORKDIR /app
COPY . .
COPY . .
RUN yarn install --production
RUN yarn install --production
+9 −2
Original line number Original line Diff line number Diff line
@@ -19,7 +19,7 @@ Go to the `app` folder.
`docker run -v "%cd%"\src:/app/src -p 127.0.0.1:3000:3000 eos-web-installer`
`docker run -v "%cd%"\src:/app/src -p 127.0.0.1:3000:3000 eos-web-installer`


## Linux
## Linux
`docker run -v "${pwd}"\src:/app/src -p 127.0.0.1:3000:3000 eos-web-installer`
`docker run -v "$(pwd)/src:/app/src" -p 127.0.0.1:3000:3000 eos-web-installer` 


The project is available at `http://localhost:3000/`
The project is available at `http://localhost:3000/`


@@ -118,6 +118,11 @@ In case of unzip : the file is unzipped, and the retrieved files are stored in t
#### Exemples
#### Exemples
```  
```  
{
{
  "android": 13,
  "security_patch_level": "2024-04-05",
  "steps": [
    ...
  ],
    "folder": [
    "folder": [
      {
      {
        "name": "recovery.img"
        "name": "recovery.img"
@@ -140,7 +145,9 @@ In case of unzip : the file is unzipped, and the retrieved files are stored in t
 }
 }
  ```
  ```



* android: Android version (optional) => Display warning if version mistach (this is the minimal current version than needs to be present in order to continue process see: Before following these instructions please ensure that the device is on the latest Android 13.0.0 firmware))
* security_patch_level (optional) => Allow to load safe procedure descriptor file (postfixed with '-safe' eg: 'teracube2e.json vs teracube2e-safe.json') that contain a specific install process (eg does not lock the bootloader if current_security_path_level > new_security_path_level new_security_path_level is the one the json file)
* folder: must be an array


## Vue
## Vue


+0 −65
Original line number Original line Diff line number Diff line
const db = require('../../src/persistence/sqlite');
const fs = require('fs');
const location = process.env.SQLITE_DB_LOCATION || '/etc/todos/todo.db';

const ITEM = {
    id: '7aef3d7c-d301-4846-8358-2a91ec9d6be3',
    name: 'Test',
    completed: false,
};

beforeEach(() => {
    if (fs.existsSync(location)) {
        fs.unlinkSync(location);
    }
});

test('it initializes correctly', async () => {
    await db.init();
});

test('it can store and retrieve items', async () => {
    await db.init();

    await db.storeItem(ITEM);

    const items = await db.getItems();
    expect(items.length).toBe(1);
    expect(items[0]).toEqual(ITEM);
});

test('it can update an existing item', async () => {
    await db.init();

    const initialItems = await db.getItems();
    expect(initialItems.length).toBe(0);

    await db.storeItem(ITEM);

    await db.updateItem(
        ITEM.id,
        Object.assign({}, ITEM, { completed: !ITEM.completed }),
    );

    const items = await db.getItems();
    expect(items.length).toBe(1);
    expect(items[0].completed).toBe(!ITEM.completed);
});

test('it can remove an existing item', async () => {
    await db.init();
    await db.storeItem(ITEM);

    await db.removeItem(ITEM.id);

    const items = await db.getItems();
    expect(items.length).toBe(0);
});

test('it can get a single item', async () => {
    await db.init();
    await db.storeItem(ITEM);

    const item = await db.getItem(ITEM.id);
    expect(item).toEqual(ITEM);
});

app/spec/routes/addItem.spec.js

deleted100644 → 0
+0 −30
Original line number Original line Diff line number Diff line
const db = require('../../src/persistence');
const addItem = require('../../src/routes/addItem');
const ITEM = { id: 12345 };
const {v4 : uuid} = require('uuid');

jest.mock('uuid', () => ({ v4: jest.fn() }));

jest.mock('../../src/persistence', () => ({
    removeItem: jest.fn(),
    storeItem: jest.fn(),
    getItem: jest.fn(),
}));

test('it stores item correctly', async () => {
    const id = 'something-not-a-uuid';
    const name = 'A sample item';
    const req = { body: { name } };
    const res = { send: jest.fn() };

    uuid.mockReturnValue(id);

    await addItem(req, res);

    const expectedItem = { id, name, completed: false };

    expect(db.storeItem.mock.calls.length).toBe(1);
    expect(db.storeItem.mock.calls[0][0]).toEqual(expectedItem);
    expect(res.send.mock.calls[0].length).toBe(1);
    expect(res.send.mock.calls[0][0]).toEqual(expectedItem);
});
Loading