Skip to content

Commit 8a3f33c

Browse files
committed
test: use first available sandbox
1 parent eb2c790 commit 8a3f33c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/nut/commands/force/org/status.nut.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,14 @@ describe('test sandbox status command', () => {
5050

5151
before(async () => {
5252
username = ensureString(env.getString('TESTKIT_HUB_USERNAME'));
53-
sandboxNameIn = ensureString(env.getString('TESTKIT_SANDBOX_NAME'));
54-
const queryStr = `SELECT Id, Status, SandboxName, SandboxInfoId, LicenseType, CreatedDate, CopyProgress, SandboxOrganization, SourceId, Description, EndDate FROM SandboxProcess WHERE SandboxName='${sandboxNameIn}' AND Status != 'D' ORDER BY CreatedDate DESC LIMIT 1`;
53+
const queryStr =
54+
"SELECT Id, Status, SandboxName, SandboxInfoId, LicenseType, CreatedDate, CopyProgress, SandboxOrganization, SourceId, Description, EndDate FROM SandboxProcess WHERE Status != 'E' and Status != 'D' ORDER BY CreatedDate DESC LIMIT 1";
5555
const connection = await Connection.create({
5656
authInfo: await AuthInfo.create({ username }),
5757
});
5858
const queryResult = (await connection.tooling.query(queryStr)) as { records: SandboxProcessObject[] };
5959
expect(queryResult?.records?.length).to.equal(1);
60+
sandboxNameIn = queryResult?.records[0]?.SandboxName;
6061
session = await TestSession.create({
6162
project: {
6263
sourceDir: path.join(process.cwd(), 'test', 'nut', 'commands', 'force', 'org'),
@@ -126,7 +127,7 @@ describe('test sandbox status command', () => {
126127

127128
expect(aliases).to.deep.equal({
128129
orgs: {
129-
nodelete: `${username}.${sandboxNameIn}`,
130+
[`${sandboxNameIn}`]: `${username}.${sandboxNameIn}`,
130131
},
131132
});
132133
});

0 commit comments

Comments
 (0)